summaryrefslogtreecommitdiffstats
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2014-05-11 11:43:31 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2014-05-11 11:43:31 (GMT)
commit1c33280c9534180733c595de160919dd86e74659 (patch)
tree94634b5bead1da641297df511d5123911b43b303 /Python/pythonrun.c
parentc89a451ae13339d803cad639f2c61af2c67f5fc2 (diff)
parent9845c7ebc5cf5af495123701664f275562f45243 (diff)
downloadcpython-1c33280c9534180733c595de160919dd86e74659.zip
cpython-1c33280c9534180733c595de160919dd86e74659.tar.gz
cpython-1c33280c9534180733c595de160919dd86e74659.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 4fd5149..b2d5464 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -1453,12 +1453,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;
}