]> granicus.if.org Git - python/commitdiff
Issue #4653: fix typo in flush_std_files()
authorVictor Stinner <victor.stinner@haypocalc.com>
Fri, 14 May 2010 00:59:09 +0000 (00:59 +0000)
committerVictor Stinner <victor.stinner@haypocalc.com>
Fri, 14 May 2010 00:59:09 +0000 (00:59 +0000)
Don't call sys.stderr.flush() if sys has no stderr attribute or if
sys.stderr==None.

Python/pythonrun.c

index e58b1c8ab993f38d6f23512f1058ce9f717e5c92..3031aef5f2b920f31f5f0573aee294e8840d9070 100644 (file)
@@ -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();