summaryrefslogtreecommitdiff
path: root/Python/errors.c
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2006-05-29 14:13:21 +0000
committerGeorg Brandl <georg@python.org>2006-05-29 14:13:21 +0000
commita70d59eed5b2e1f69efa48e211f0cd94faba7f85 (patch)
treea1f4d9892d53ea45015baa9b9252d32992897cd8 /Python/errors.c
parent088b8c8bfb83e5a84dd0f9783dfe6961ec802935 (diff)
downloadcpython-a70d59eed5b2e1f69efa48e211f0cd94faba7f85.tar.gz
Fix #1494605.
Diffstat (limited to 'Python/errors.c')
-rw-r--r--Python/errors.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/errors.c b/Python/errors.c
index a40f073788..56463a30a0 100644
--- a/Python/errors.c
+++ b/Python/errors.c
@@ -728,7 +728,8 @@ PyErr_SyntaxLocation(const char *filename, int lineno)
tmp = PyErr_ProgramText(filename, lineno);
if (tmp) {
- PyObject_SetAttrString(v, "text", tmp);
+ if (PyObject_SetAttrString(v, "text", tmp))
+ PyErr_Clear();
Py_DECREF(tmp);
}
}