Browse Source
bpo-42206: Propagate and raise errors from PyAST_Validate in the parser (GH-23035)
pull/23036/head
Batuhan Taskaya
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
5 additions and
1 deletions
-
Misc/NEWS.d/next/Core and Builtins/2020-10-30-13-11-01.bpo-42206.xxssR8.rst
-
Parser/pegen.c
|
|
|
@ -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_eval_input) |
|
|
|
{ |
|
|
|
assert(PyAST_Validate(res)); |
|
|
|
if (!PyAST_Validate(res)) { |
|
|
|
return NULL; |
|
|
|
} |
|
|
|
} |
|
|
|
#endif |
|
|
|
return res; |
|
|
|
|