]> granicus.if.org Git - python/commitdiff
Issue #5319: Print an error if flushing stdout fails at interpreter
authorAntoine Pitrou <solipsis@pitrou.net>
Sun, 8 Aug 2010 20:46:42 +0000 (20:46 +0000)
committerAntoine Pitrou <solipsis@pitrou.net>
Sun, 8 Aug 2010 20:46:42 +0000 (20:46 +0000)
shutdown.

Misc/NEWS
Python/pythonrun.c

index 294382cedded4a1a7b2f60a8bbd8be7fe93b212d..9f3d80a63d42b12472168114172b0b6d7f38f160 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -12,6 +12,9 @@ What's New in Python 3.2 Alpha 2?
 Core and Builtins
 -----------------
 
+- Issue #5319: Print an error if flushing stdout fails at interpreter
+  shutdown.
+
 - Issue #9337: The str() of a float or complex number is now identical
   to its repr().
 
index 79a19f8dd70a04202c0e53d0e0cff32ef3d1bfde..233fc16ea136fac83d4152525da72e9ed11a3bcf 100644 (file)
@@ -320,7 +320,7 @@ flush_std_files(void)
     if (fout != NULL && fout != Py_None) {
         tmp = PyObject_CallMethod(fout, "flush", "");
         if (tmp == NULL)
-            PyErr_Clear();
+            PyErr_WriteUnraisable(fout);
         else
             Py_DECREF(tmp);
     }