[Python-checkins] cpython: print_exception(): handle correctly PyObject_GetAttrString() failure
victor.stinner
python-checkins at python.org
Thu May 26 14:25:57 CEST 2011
http://hg.python.org/cpython/rev/2e72fcfb2527
changeset: 70402:2e72fcfb2527
user: Victor Stinner <victor.stinner at haypocalc.com>
date: Thu May 26 14:25:13 2011 +0200
summary:
print_exception(): handle correctly PyObject_GetAttrString() failure
Bug found by the Clang Static Analyzer.
files:
Python/pythonrun.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -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 {
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list