print_exception(): handle correctly PyObject_GetAttrString() failure
Bug found by the Clang Static Analyzer.
This commit is contained in:
parent
a1a807b6ef
commit
13b21bd749
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue