Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9467b21

Browse files
author
Victor Stinner
committed
Issue #4653: fix typo in flush_std_files()
Don't call sys.stderr.flush() if sys has no stderr attribute or if sys.stderr==None.
1 parent 84df1e6 commit 9467b21

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Python/pythonrun.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ flush_std_files(void)
334334
Py_DECREF(tmp);
335335
}
336336

337-
if (ferr != NULL || ferr != Py_None) {
337+
if (ferr != NULL && ferr != Py_None) {
338338
tmp = PyObject_CallMethod(ferr, "flush", "");
339339
if (tmp == NULL)
340340
PyErr_Clear();

0 commit comments

Comments
 (0)