diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-05-26 14:25:13 +0200 |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-05-26 14:25:13 +0200 |
commit | 48f7ac826a35230300859e8bfba3b7339efab679 (patch) | |
tree | 870f5dc1c5b672ba66a720d97a3c2a848b5ec8e3 /Python/pythonrun.c | |
parent | f4cbb850ab23ff4b74c6c958b17fc4c723766b17 (diff) | |
download | cpython-48f7ac826a35230300859e8bfba3b7339efab679.tar.gz |
print_exception(): handle correctly PyObject_GetAttrString() failure
Bug found by the Clang Static Analyzer.
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r-- | Python/pythonrun.c | 2 |
1 files changed, 1 insertions, 1 deletions
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("<unknown>", f); } else { |