summaryrefslogtreecommitdiffstats
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2014-05-11 11:42:17 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2014-05-11 11:42:17 (GMT)
commit9845c7ebc5cf5af495123701664f275562f45243 (patch)
treec0c52f85ae3cd6fb4862b34f74cc213d4d610626 /Python/pythonrun.c
parent3d1bc608a842b375eb7921d57e417f2dfaa5b71e (diff)
downloadcpython-9845c7ebc5cf5af495123701664f275562f45243.zip
cpython-9845c7ebc5cf5af495123701664f275562f45243.tar.gz
cpython-9845c7ebc5cf5af495123701664f275562f45243.tar.bz2
Issue #21425: Fix flushing of standard streams in the interactive interpreter.
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r--Python/pythonrun.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index b3991ea..0327830 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -1444,12 +1444,13 @@ PyRun_InteractiveOneObject(FILE *fp, PyObject *filename, PyCompilerFlags *flags)
d = PyModule_GetDict(m);
v = run_mod(mod, filename, d, d, flags, arena);
PyArena_Free(arena);
- flush_io();
if (v == NULL) {
PyErr_Print();
+ flush_io();
return -1;
}
Py_DECREF(v);
+ flush_io();
return 0;
}