From 00723e03536c8494e692767f8495800188843d6f Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 3 Sep 2015 12:57:11 +0200 Subject: [PATCH] Fix ast_for_atom() Clear PyObject_Str() exception if it failed, ast_error() should not be called with an exception set. --- Python/ast.c | 1 + 1 file changed, 1 insertion(+) 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); -- 2.50.1