diff Python/pythonrun.c @ 70402:2e72fcfb2527

print_exception(): handle correctly PyObject_GetAttrString() failure Bug found by the Clang Static Analyzer.
author Victor Stinner <victor.stinner@haypocalc.com>
date Thu, 26 May 2011 14:25:13 +0200
parents 94e3c44b0662
children 7ce685cda0ae
line wrap: on
line diff
--- a/Python/pythonrun.c	Thu May 26 14:24:30 2011 +0200
+++ b/Python/pythonrun.c	Thu May 26 14:25:13 2011 +0200
@@ -1593,7 +1593,7 @@
         moduleName = PyObject_GetAttrString(type, "__module__");
         if (moduleName == NULL || !PyUnicode_Check(moduleName))
         {
-            Py_DECREF(moduleName);
+            Py_XDECREF(moduleName);
             err = PyFile_WriteString("<unknown>", f);
         }
         else {