mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
bpo-44143: Fix crash in the parser when raising tokenizer errors with an exception set (GH-26144)
This commit is contained in:
parent
086b5c6ce1
commit
80b089179f
3 changed files with 4 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue