diff options
author | Georg Brandl <georg@python.org> | 2007-03-12 14:30:05 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2007-03-12 14:30:05 (GMT) |
commit | 7b9c555520436b8bd1805202e7b0d1329f05b321 (patch) | |
tree | 50ec0cb0ccda2a35ac438b8fdff5a8f888d18f41 /Python/pythonrun.c | |
parent | 871f1bc6011c1644b1be2e87518c435e7fb552ad (diff) | |
download | cpython-7b9c555520436b8bd1805202e7b0d1329f05b321.zip cpython-7b9c555520436b8bd1805202e7b0d1329f05b321.tar.gz cpython-7b9c555520436b8bd1805202e7b0d1329f05b321.tar.bz2 |
Bug #1678647: write a newline after printing an exception in any
case, even when converting the value to a string failed.
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r-- | Python/pythonrun.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 454afe4..3a9e75e 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -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. |