From: Victor Stinner Date: Thu, 26 May 2011 12:25:13 +0000 (+0200) Subject: print_exception(): handle correctly PyObject_GetAttrString() failure X-Git-Tag: v3.3.0a1~2183^2~89 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=13b21bd749aef0f6b18cec0e7e5d1d3e643f106a;p=python print_exception(): handle correctly PyObject_GetAttrString() failure Bug found by the Clang Static Analyzer. --- diff --git a/Python/pythonrun.c b/Python/pythonrun.c index b55dc5b201..232d7befa0 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -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("", f); } else {