]> granicus.if.org Git - python/commitdiff
Fix #1494605.
authorGeorg Brandl <georg@python.org>
Mon, 29 May 2006 14:13:21 +0000 (14:13 +0000)
committerGeorg Brandl <georg@python.org>
Mon, 29 May 2006 14:13:21 +0000 (14:13 +0000)
Python/errors.c

index a40f073788b7c722fd712b1ce7bb01371dcfa74f..56463a30a07035056a82493611f803ea16e5b917 100644 (file)
@@ -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);
                }
        }