summaryrefslogtreecommitdiffstats
path: root/Python/ast.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-09-03 10:57:11 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2015-09-03 10:57:11 (GMT)
commit00723e03536c8494e692767f8495800188843d6f (patch)
tree1f98d5d5612fb5f82113ca86b73a82faf67f226f /Python/ast.c
parent99bb14bf0c4b9bdef2535710cc14abbdf5aa648a (diff)
downloadcpython-00723e03536c8494e692767f8495800188843d6f.zip
cpython-00723e03536c8494e692767f8495800188843d6f.tar.gz
cpython-00723e03536c8494e692767f8495800188843d6f.tar.bz2
Fix ast_for_atom()
Clear PyObject_Str() exception if it failed, ast_error() should not be called with an exception set.
Diffstat (limited to 'Python/ast.c')
-rw-r--r--Python/ast.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Python/ast.c b/Python/ast.c
index c1ce0aa..1f7ddfc 100644
--- a/Python/ast.c
+++ b/Python/ast.c
@@ -2040,6 +2040,7 @@ ast_for_atom(struct compiling *c, const node *n)
PyOS_snprintf(buf, sizeof(buf), "(%s) %s", errtype, s);
Py_DECREF(errstr);
} else {
+ PyErr_Clear();
PyOS_snprintf(buf, sizeof(buf), "(%s) unknown error", errtype);
}
ast_error(c, n, buf);