summaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
Diffstat (limited to 'Python')
-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);
}
}