Skip to content

Commit 2401816

Browse files
committed
BUG: Fix regression introduced in setRedirectStdInCallbackEnabled
This commit fixes a regression introduced in 90220d9 ("[Backport] Replace NULL with nullptr", 2023-01-01)
1 parent bc1d090 commit 2401816

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/PythonQt.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,11 +509,11 @@ void PythonQt::setRedirectStdInCallbackEnabled(bool enabled)
509509
sys.setNewRef(PyImport_ImportModule("sys"));
510510

511511
if (enabled) {
512-
if( !PyObject_HasAttrString(sys.object(), "pythonqt_stdin") ) {
512+
if( PyObject_HasAttrString(sys.object(), "pythonqt_stdin") ) {
513513
PyObject_SetAttrString(sys.object(), "stdin", PyObject_GetAttrString(sys.object(), "pythonqt_stdin"));
514514
}
515515
} else {
516-
if( !PyObject_HasAttrString(sys.object(), "pythonqt_original_stdin") ) {
516+
if( PyObject_HasAttrString(sys.object(), "pythonqt_original_stdin") ) {
517517
PyObject_SetAttrString(sys.object(), "stdin", PyObject_GetAttrString(sys.object(), "pythonqt_original_stdin"));
518518
}
519519
}

0 commit comments

Comments
 (0)