Skip to content

Commit 9ea0fcf

Browse files
committed
Fix name clash with Visual Studio 2017
1 parent b5a88e1 commit 9ea0fcf

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/PythonQt.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -424,9 +424,9 @@ void PythonQt::setRedirectStdInCallback(PythonQtInputChangedCB* callback, void *
424424

425425
// Backup original 'sys.stdin' if not yet done
426426
if( !PyObject_HasAttrString(sys.object(), "pythonqt_original_stdin") ) {
427-
PyObject *stdin = PyObject_GetAttrString(sys.object(), "stdin");
428-
PyObject_SetAttrString(sys.object(), "pythonqt_original_stdin", stdin);
429-
Py_XDECREF(stdin);
427+
PyObject *_stdin = PyObject_GetAttrString(sys.object(), "stdin");
428+
PyObject_SetAttrString(sys.object(), "pythonqt_original_stdin", _stdin);
429+
Py_XDECREF(_stdin);
430430
}
431431

432432
in = PythonQtStdInRedirectType.tp_new(&PythonQtStdInRedirectType, NULL, NULL);
@@ -445,18 +445,18 @@ void PythonQt::setRedirectStdInCallbackEnabled(bool enabled)
445445
PythonQtObjectPtr sys;
446446
sys.setNewRef(PyImport_ImportModule("sys"));
447447

448-
PythonQtObjectPtr stdin;
448+
PythonQtObjectPtr _stdin;
449449
if (enabled) {
450450
if( PyObject_HasAttrString(sys.object(), "pythonqt_stdin") ) {
451-
stdin.setNewRef(PyObject_GetAttrString(sys.object(), "pythonqt_stdin"));
451+
_stdin.setNewRef(PyObject_GetAttrString(sys.object(), "pythonqt_stdin"));
452452
}
453453
} else {
454454
if( PyObject_HasAttrString(sys.object(), "pythonqt_original_stdin") ) {
455-
stdin.setNewRef(PyObject_GetAttrString(sys.object(), "pythonqt_original_stdin"));
455+
_stdin.setNewRef(PyObject_GetAttrString(sys.object(), "pythonqt_original_stdin"));
456456
}
457457
}
458-
if (stdin) {
459-
PyObject_SetAttrString(sys.object(), "stdin", stdin);
458+
if (_stdin) {
459+
PyObject_SetAttrString(sys.object(), "stdin", _stdin);
460460
}
461461
}
462462

0 commit comments

Comments
 (0)