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

This commit is contained in:
Antoine Pitrou 2014-05-11 13:43:31 +02:00
commit 1c33280c95
4 changed files with 56 additions and 3 deletions

View file

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