summaryrefslogtreecommitdiff
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2014-05-11 13:42:17 +0200
committerAntoine Pitrou <solipsis@pitrou.net>2014-05-11 13:42:17 +0200
commitf47decfb7e79c1553c1f9e54bbab2aae2ffe0411 (patch)
treebba245465b72b476503ae068e6995b5e7dd1633e /Python/pythonrun.c
parent8d89c2d892e143abcaab2a81b7a78281e5082dad (diff)
downloadcpython-f47decfb7e79c1553c1f9e54bbab2aae2ffe0411.tar.gz
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 b3991ead91..0327830247 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;
}