Issue #21425: Fix flushing of standard streams in the interactive interpreter.

This commit is contained in:
Antoine Pitrou 2014-05-11 13:42:17 +02:00
parent 3d1bc608a8
commit 9845c7ebc5
4 changed files with 57 additions and 4 deletions

View file

@ -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;
}