diff Python/pythonrun.c @ 63846:4ca497f4819c

Issue #5319: Print an error if flushing stdout fails at interpreter shutdown.
author Antoine Pitrou <solipsis@pitrou.net>
date Sun, 08 Aug 2010 20:46:42 +0000
parents c16803bbd790
children 1bd3534136a0
line wrap: on
line diff
--- a/Python/pythonrun.c	Sun Aug 08 19:48:29 2010 +0000
+++ b/Python/pythonrun.c	Sun Aug 08 20:46:42 2010 +0000
@@ -320,7 +320,7 @@
     if (fout != NULL && fout != Py_None) {
         tmp = PyObject_CallMethod(fout, "flush", "");
         if (tmp == NULL)
-            PyErr_Clear();
+            PyErr_WriteUnraisable(fout);
         else
             Py_DECREF(tmp);
     }