mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-100050: Fix an assertion error when raising unclosed parenthesis errors in the tokenizer (GH-100065)
Automerge-Triggered-By: GH:pablogsal
This commit is contained in:
parent
abbe4482ab
commit
97e7004cfe
3 changed files with 22 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue