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:
Georg Brandl 2007-03-12 14:30:05 +00:00
parent 871f1bc601
commit 7b9c555520
2 changed files with 5 additions and 2 deletions

View file

@ -12,6 +12,9 @@ What's New in Python 2.6 alpha 1?
Core and builtins Core and builtins
----------------- -----------------
- Bug #1678647: write a newline after printing an exception in any
case, even when converting the value to a string failed.
- The dir() function has been extended to call the __dir__() method on - The dir() function has been extended to call the __dir__() method on
its argument, if it exists. If not, it will work like before. This allows its argument, if it exists. If not, it will work like before. This allows
customizing the output of dir() in the presence of a __getattr__(). customizing the output of dir() in the presence of a __getattr__().

View file

@ -1226,8 +1226,8 @@ PyErr_Display(PyObject *exception, PyObject *value, PyObject *tb)
err = PyFile_WriteObject(s, f, Py_PRINT_RAW); err = PyFile_WriteObject(s, f, Py_PRINT_RAW);
Py_XDECREF(s); Py_XDECREF(s);
} }
if (err == 0) /* try to write a newline in any case */
err = PyFile_WriteString("\n", f); err += PyFile_WriteString("\n", f);
} }
Py_DECREF(value); Py_DECREF(value);
/* If an error happened here, don't show it. /* If an error happened here, don't show it.