bpo-42206: Propagate and raise errors from PyAST_Validate in the parser (GH-23035)
This commit is contained in:
parent
d6238ba82d
commit
3af4b58552
|
@ -0,0 +1,2 @@
|
||||||
|
Propagate and raise the errors caused by :c:func:`PyAST_Validate` in the
|
||||||
|
parser.
|
|
@ -1157,7 +1157,9 @@ _PyPegen_run_parser(Parser *p)
|
||||||
p->start_rule == Py_file_input ||
|
p->start_rule == Py_file_input ||
|
||||||
p->start_rule == Py_eval_input)
|
p->start_rule == Py_eval_input)
|
||||||
{
|
{
|
||||||
assert(PyAST_Validate(res));
|
if (!PyAST_Validate(res)) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return res;
|
return res;
|
||||||
|
|
Loading…
Reference in New Issue