summaryrefslogtreecommitdiff
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2007-03-12 14:30:05 +0000
committerGeorg Brandl <georg@python.org>2007-03-12 14:30:05 +0000
commit0479917c00cd3ca2d2b5d82968b9832397a6024b (patch)
treee3e1ebf98f5e057f40cf603e11cc4294dee1bfb0 /Python/pythonrun.c
parent151c05b176a7844b013e03476b50516c8935379d (diff)
downloadcpython-0479917c00cd3ca2d2b5d82968b9832397a6024b.tar.gz
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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index 454afe47f7..3a9e75e237 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.