summaryrefslogtreecommitdiffstats
path: root/Parser
diff options
context:
space:
mode:
authorPablo Galindo Salgado <Pablogsal@gmail.com>2022-12-06 23:09:56 (GMT)
committerGitHub <noreply@github.com>2022-12-06 23:09:56 (GMT)
commit97e7004cfe48305bcd642c653b406dc7470e196d (patch)
tree7cbdfd5e01f133d61f21d66d5add469968a452f5 /Parser
parentabbe4482ab914d6da8b1678ad46174cb875ed7f6 (diff)
downloadcpython-97e7004cfe48305bcd642c653b406dc7470e196d.zip
cpython-97e7004cfe48305bcd642c653b406dc7470e196d.tar.gz
cpython-97e7004cfe48305bcd642c653b406dc7470e196d.tar.bz2
gh-100050: Fix an assertion error when raising unclosed parenthesis errors in the tokenizer (GH-100065)
Automerge-Triggered-By: GH:pablogsal
Diffstat (limited to 'Parser')
-rw-r--r--Parser/pegen_errors.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Parser/pegen_errors.c b/Parser/pegen_errors.c
index 7738cba..6ea7600 100644
--- a/Parser/pegen_errors.c
+++ b/Parser/pegen_errors.c
@@ -169,6 +169,10 @@ _PyPegen_tokenize_full_source_to_check_for_errors(Parser *p) {
for (;;) {
switch (_PyTokenizer_Get(p->tok, &new_token)) {
case ERRORTOKEN:
+ if (PyErr_Occurred()) {
+ ret = -1;
+ goto exit;
+ }
if (p->tok->level != 0) {
int error_lineno = p->tok->parenlinenostack[p->tok->level-1];
if (current_err_line > error_lineno) {