mirror of
https://github.com/python/cpython.git
synced 2025-08-21 17:25:34 +00:00
Fix SF bug #1669182. Handle string exceptions even if unraisable (ie in __del__).
This commit is contained in:
parent
366bf0d9cb
commit
036b3beca8
2 changed files with 8 additions and 1 deletions
|
@ -12,6 +12,9 @@ What's New in Python 2.5.1c1?
|
||||||
Core and builtins
|
Core and builtins
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
|
- Bug #1669182: prevent crash when trying to print an unraisable error
|
||||||
|
from a string exception.
|
||||||
|
|
||||||
- Bug #1653736: Properly discard third argument to slot_nb_inplace_power.
|
- Bug #1653736: Properly discard third argument to slot_nb_inplace_power.
|
||||||
|
|
||||||
- SF #151204: enumerate() now raises an Overflow error at sys.maxint items.
|
- SF #151204: enumerate() now raises an Overflow error at sys.maxint items.
|
||||||
|
|
|
@ -590,7 +590,11 @@ PyErr_WriteUnraisable(PyObject *obj)
|
||||||
PyFile_WriteString("Exception ", f);
|
PyFile_WriteString("Exception ", f);
|
||||||
if (t) {
|
if (t) {
|
||||||
PyObject* moduleName;
|
PyObject* moduleName;
|
||||||
char* className = PyExceptionClass_Name(t);
|
char* className = NULL;
|
||||||
|
if (PyExceptionClass_Check(t))
|
||||||
|
className = PyExceptionClass_Name(t);
|
||||||
|
else if (PyString_Check(t))
|
||||||
|
className = PyString_AS_STRING(t);
|
||||||
|
|
||||||
if (className != NULL) {
|
if (className != NULL) {
|
||||||
char *dot = strrchr(className, '.');
|
char *dot = strrchr(className, '.');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue