diff options
author | Pablo Galindo <Pablogsal@gmail.com> | 2021-05-15 16:58:02 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-15 16:58:02 (GMT) |
commit | 80b089179fa798c8ceaab2ff699c82499b2fcacd (patch) | |
tree | 9b1be535d529b1e25c22695c9a8d818360575662 /Parser | |
parent | 086b5c6ce16b524629428b4fd5c9213930bfca47 (diff) | |
download | cpython-80b089179fa798c8ceaab2ff699c82499b2fcacd.zip cpython-80b089179fa798c8ceaab2ff699c82499b2fcacd.tar.gz cpython-80b089179fa798c8ceaab2ff699c82499b2fcacd.tar.bz2 |
bpo-44143: Fix crash in the parser when raising tokenizer errors with an exception set (GH-26144)
Diffstat (limited to 'Parser')
-rw-r--r-- | Parser/pegen.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Parser/pegen.c b/Parser/pegen.c index 6080cec..c2f2540 100644 --- a/Parser/pegen.c +++ b/Parser/pegen.c @@ -1259,6 +1259,7 @@ _PyPegen_check_tokenizer_errors(Parser *p) { if (p->tok->level != 0) { int error_lineno = p->tok->parenlinenostack[p->tok->level-1]; if (current_err_line > error_lineno) { + PyErr_Clear(); raise_unclosed_parentheses_error(p); return -1; } |