diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2007-02-26 23:46:51 +0000 |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2007-02-26 23:46:51 +0000 |
commit | 036b3beca80cf2ccd6ffe98cf5d10eb8ee5e8b19 (patch) | |
tree | 184711d659bb2ee0659e80f580b3d3949337c596 /Python/errors.c | |
parent | 366bf0d9cb0847c70290cf6200a99a27969ec5ee (diff) | |
download | cpython-git-036b3beca80cf2ccd6ffe98cf5d10eb8ee5e8b19.tar.gz |
Fix SF bug #1669182. Handle string exceptions even if unraisable (ie in __del__).
Diffstat (limited to 'Python/errors.c')
-rw-r--r-- | Python/errors.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Python/errors.c b/Python/errors.c index f31f025112..bc77c3c1b7 100644 --- a/Python/errors.c +++ b/Python/errors.c @@ -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, '.'); |