From: Victor Stinner Date: Fri, 14 May 2010 00:59:09 +0000 (+0000) Subject: Issue #4653: fix typo in flush_std_files() X-Git-Tag: v3.2a1~815 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9467b212f5dd4558443d03584e1ed9bca5a2b780;p=python 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. --- diff --git a/Python/pythonrun.c b/Python/pythonrun.c index e58b1c8ab9..3031aef5f2 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -334,7 +334,7 @@ flush_std_files(void) Py_DECREF(tmp); } - if (ferr != NULL || ferr != Py_None) { + if (ferr != NULL && ferr != Py_None) { tmp = PyObject_CallMethod(ferr, "flush", ""); if (tmp == NULL) PyErr_Clear();