summaryrefslogtreecommitdiffstats
path: root/Parser
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2021-05-15 17:39:18 (GMT)
committerGitHub <noreply@github.com>2021-05-15 17:39:18 (GMT)
commit1afaaf5a2dc901377bb17f6fbe0cff7bf3b797e3 (patch)
tree8077b1daccf483b10e82c9fb0e036a898fa48f7e /Parser
parenta38db84122b4f664ee30b9ffd55ce87b7f4517ac (diff)
downloadcpython-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.c1
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;
}