Fix ast_for_atom()

Clear PyObject_Str() exception if it failed, ast_error() should not be called
with an exception set.
This commit is contained in:
Victor Stinner 2015-09-03 12:57:11 +02:00
parent 99bb14bf0c
commit 00723e0353
1 changed files with 1 additions and 0 deletions

View File

@ -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);