Skip to content

Commit c35cb95

Browse files
committed
Fix ast_for_atom()
Clear PyObject_Str() exception if it failed, ast_error() should not be called with an exception set.
1 parent da123f4 commit c35cb95

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

Python/ast.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2040,6 +2040,7 @@ ast_for_atom(struct compiling *c, const node *n)
20402040
PyOS_snprintf(buf, sizeof(buf), "(%s) %s", errtype, s);
20412041
Py_DECREF(errstr);
20422042
} else {
2043+
PyErr_Clear();
20432044
PyOS_snprintf(buf, sizeof(buf), "(%s) unknown error", errtype);
20442045
}
20452046
ast_error(c, n, buf);

0 commit comments

Comments
 (0)