print_exception(): handle correctly PyObject_GetAttrString() failure

Bug found by the Clang Static Analyzer.
This commit is contained in:
Victor Stinner 2011-05-26 14:25:13 +02:00
parent a1a807b6ef
commit 13b21bd749
1 changed files with 1 additions and 1 deletions

View File

@ -1593,7 +1593,7 @@ print_exception(PyObject *f, PyObject *value)
moduleName = PyObject_GetAttrString(type, "__module__");
if (moduleName == NULL || !PyUnicode_Check(moduleName))
{
Py_DECREF(moduleName);
Py_XDECREF(moduleName);
err = PyFile_WriteString("<unknown>", f);
}
else {