Fix SF bug #1669182. Handle string exceptions even if unraisable (ie in __del__).

This commit is contained in:
Neal Norwitz 2007-02-26 23:46:51 +00:00
parent 366bf0d9cb
commit 036b3beca8
2 changed files with 8 additions and 1 deletions

View file

@ -590,7 +590,11 @@ PyErr_WriteUnraisable(PyObject *obj)
PyFile_WriteString("Exception ", f);
if (t) {
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) {
char *dot = strrchr(className, '.');