summaryrefslogtreecommitdiff
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-05-14 00:59:09 +0000
committerVictor Stinner <victor.stinner@haypocalc.com>2010-05-14 00:59:09 +0000
commit5266e4236ff854c931fb0f6b958539e243da015f (patch)
treefebe56dfbe1d7ca1001e801e505ba8c306629c2d /Python/pythonrun.c
parent3cb0c2d4c164167fbb69c51d848d72a5bd8931d1 (diff)
downloadcpython-5266e4236ff854c931fb0f6b958539e243da015f.tar.gz
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.
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r--Python/pythonrun.c2
1 files changed, 1 insertions, 1 deletions
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();