aboutsummaryrefslogtreecommitdiff
path: root/Parser
diff options
context:
space:
mode:
authorBatuhan Taskaya <batuhanosmantaskaya@gmail.com>2020-10-30 14:48:41 +0300
committerGitHub <noreply@github.com>2020-10-30 11:48:41 +0000
commit3af4b585527743e455145d294049c46b7c823ed9 (patch)
tree7168b564b07fbc6700298a075a06a7c3491bd98f /Parser
parentbpo-42172: Correct typo for test_socket.py (GH-23013) (diff)
downloadcpython-3af4b585527743e455145d294049c46b7c823ed9.tar.gz
cpython-3af4b585527743e455145d294049c46b7c823ed9.tar.bz2
cpython-3af4b585527743e455145d294049c46b7c823ed9.zip
bpo-42206: Propagate and raise errors from PyAST_Validate in the parser (GH-23035)
Diffstat (limited to 'Parser')
-rw-r--r--Parser/pegen.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Parser/pegen.c b/Parser/pegen.c
index 827d4dace1f..216edd810e2 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;