From: Antoine Pitrou Date: Sun, 8 Aug 2010 20:46:42 +0000 (+0000) Subject: Issue #5319: Print an error if flushing stdout fails at interpreter X-Git-Tag: v3.2a2~413 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bddc9fe22bb5d78bfb3db891d3b2d56d963f6e04;p=thirdparty%2FPython%2Fcpython.git Issue #5319: Print an error if flushing stdout fails at interpreter shutdown. --- diff --git a/Misc/NEWS b/Misc/NEWS index 294382cedded..9f3d80a63d42 100644 --- 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(). diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 79a19f8dd70a..233fc16ea136 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -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); }