]> granicus.if.org Git - python/commitdiff
SF #1669182, 2.5 was already fixed. Just assert in 2.6 since string exceptions
authorNeal Norwitz <nnorwitz@gmail.com>
Mon, 26 Feb 2007 23:48:27 +0000 (23:48 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Mon, 26 Feb 2007 23:48:27 +0000 (23:48 +0000)
are gone.

Python/errors.c

index 9a23c05282834b0f2b6aff5f263ab0f1aa794004..3b8ea64f67398d6121699b9782de38a213d40751 100644 (file)
@@ -590,8 +590,9 @@ PyErr_WriteUnraisable(PyObject *obj)
                PyFile_WriteString("Exception ", f);
                if (t) {
                        PyObject* moduleName;
-                       char* className = PyExceptionClass_Name(t);
-
+                       char* className;
+                       assert(PyExceptionClass_Check(t));
+                       className = PyExceptionClass_Name(t);
                        if (className != NULL) {
                                char *dot = strrchr(className, '.');
                                if (dot != NULL)