mirror of
https://github.com/python/cpython.git
synced 2026-05-18 18:33:57 -04:00
Bug #1678647: write a newline after printing an exception in any
case, even when converting the value to a string failed.
This commit is contained in:
+2
-2
@@ -1226,8 +1226,8 @@ PyErr_Display(PyObject *exception, PyObject *value, PyObject *tb)
|
||||
err = PyFile_WriteObject(s, f, Py_PRINT_RAW);
|
||||
Py_XDECREF(s);
|
||||
}
|
||||
if (err == 0)
|
||||
err = PyFile_WriteString("\n", f);
|
||||
/* try to write a newline in any case */
|
||||
err += PyFile_WriteString("\n", f);
|
||||
}
|
||||
Py_DECREF(value);
|
||||
/* If an error happened here, don't show it.
|
||||
|
||||
Reference in New Issue
Block a user