[Python-checkins] bpo-42206: Propagate and raise errors from PyAST_Validate in the parser (GH-23035)

pablogsal webhook-mailer at python.org
Fri Oct 30 07:49:11 EDT 2020


https://github.com/python/cpython/commit/3af4b585527743e455145d294049c46b7c823ed9
commit: 3af4b585527743e455145d294049c46b7c823ed9
branch: master
author: Batuhan Taskaya <batuhanosmantaskaya at gmail.com>
committer: pablogsal <Pablogsal at gmail.com>
date: 2020年10月30日T11:48:41Z
summary:
bpo-42206: Propagate and raise errors from PyAST_Validate in the parser (GH-23035)
files:
A Misc/NEWS.d/next/Core and Builtins/2020-10-30-13-11-01.bpo-42206.xxssR8.rst
M Parser/pegen.c
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-10-30-13-11-01.bpo-42206.xxssR8.rst b/Misc/NEWS.d/next/Core and Builtins/2020-10-30-13-11-01.bpo-42206.xxssR8.rst
new file mode 100644
index 0000000000000..b9eb135fec5e9
--- /dev/null
+++ b/Misc/NEWS.d/next/Core and Builtins/2020-10-30-13-11-01.bpo-42206.xxssR8.rst	
@@ -0,0 +1,2 @@
+Propagate and raise the errors caused by :c:func:`PyAST_Validate` in the
+parser.
diff --git a/Parser/pegen.c b/Parser/pegen.c
index 827d4dace1fc3..216edd810e246 100644
--- a/Parser/pegen.c
+++ b/Parser/pegen.c
@@ -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;


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /