summaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-09-03 12:57:11 +0200
committerVictor Stinner <victor.stinner@gmail.com>2015-09-03 12:57:11 +0200
commit00723e03536c8494e692767f8495800188843d6f (patch)
tree1f98d5d5612fb5f82113ca86b73a82faf67f226f /Python
parent99bb14bf0c4b9bdef2535710cc14abbdf5aa648a (diff)
downloadcpython-git-00723e03536c8494e692767f8495800188843d6f.tar.gz
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')
-rw-r--r--Python/ast.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Python/ast.c b/Python/ast.c
index c1ce0aa9aa..1f7ddfc197 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);