From a1121fa9350f16bbae18b66b8c3825fd5e4706f6 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Mon, 29 May 2006 14:13:21 +0000 Subject: Fix #1494605. --- Python/errors.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Python/errors.c') 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); } } -- cgit v1.2.1