From: Victor Stinner Date: Thu, 3 Sep 2015 10:57:11 +0000 (+0200) Subject: Fix ast_for_atom() X-Git-Tag: v3.6.0a1~1688 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=00723e03536c8494e692767f8495800188843d6f;p=thirdparty%2FPython%2Fcpython.git Fix ast_for_atom() Clear PyObject_Str() exception if it failed, ast_error() should not be called with an exception set. --- diff --git a/Python/ast.c b/Python/ast.c index c1ce0aa9aaa8..1f7ddfc1978c 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);