From 9845c7ebc5cf5af495123701664f275562f45243 Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Sun, 11 May 2014 13:42:17 +0200 Subject: Issue #21425: Fix flushing of standard streams in the interactive interpreter. --- Python/pythonrun.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Python/pythonrun.c') 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; } -- cgit v1.2.1