Issue #21425: Fix flushing of standard streams in the interactive interpreter.
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index b3991ea..0327830 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -1444,12 +1444,13 @@
     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;
 }