diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2021-05-15 17:39:18 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-15 17:39:18 (GMT) |
commit | 1afaaf5a2dc901377bb17f6fbe0cff7bf3b797e3 (patch) | |
tree | 8077b1daccf483b10e82c9fb0e036a898fa48f7e /Parser | |
parent | a38db84122b4f664ee30b9ffd55ce87b7f4517ac (diff) | |
download | cpython-1afaaf5a2dc901377bb17f6fbe0cff7bf3b797e3.zip cpython-1afaaf5a2dc901377bb17f6fbe0cff7bf3b797e3.tar.gz cpython-1afaaf5a2dc901377bb17f6fbe0cff7bf3b797e3.tar.bz2 |
bpo-44143: Fix crash in the parser when raising tokenizer errors with an exception set (GH-26144) (GH-26148)
(cherry picked from commit 80b089179fa798c8ceaab2ff699c82499b2fcacd)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
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; } |