Skip to content

Commit bddc9fe

Browse files
committed
Issue #5319: Print an error if flushing stdout fails at interpreter
shutdown.
1 parent c17f172 commit bddc9fe

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ What's New in Python 3.2 Alpha 2?
1212
Core and Builtins
1313
-----------------
1414

15+
- Issue #5319: Print an error if flushing stdout fails at interpreter
16+
shutdown.
17+
1518
- Issue #9337: The str() of a float or complex number is now identical
1619
to its repr().
1720

Python/pythonrun.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ flush_std_files(void)
320320
if (fout != NULL && fout != Py_None) {
321321
tmp = PyObject_CallMethod(fout, "flush", "");
322322
if (tmp == NULL)
323-
PyErr_Clear();
323+
PyErr_WriteUnraisable(fout);
324324
else
325325
Py_DECREF(tmp);
326326
}

0 commit comments

Comments
 (0)