From 13b21bd749aef0f6b18cec0e7e5d1d3e643f106a Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 26 May 2011 14:25:13 +0200 Subject: print_exception(): handle correctly PyObject_GetAttrString() failure Bug found by the Clang Static Analyzer. --- Python/pythonrun.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Python/pythonrun.c') 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 { -- cgit v1.2.1