From 7b9c555520436b8bd1805202e7b0d1329f05b321 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Mon, 12 Mar 2007 14:30:05 +0000 Subject: Bug #1678647: write a newline after printing an exception in any case, even when converting the value to a string failed. --- Python/pythonrun.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Python/pythonrun.c') diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 454afe47f78..3a9e75e2373 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. -- cgit v1.2.3