Skip to content

Commit 7f06af6

Browse files
authored
bpo-40334: Set error_indicator in _PyPegen_raise_error (GH-19887)
Due to PyErr_Occurred not being called at the beginning of each rule, we need to set the error indicator, so that rules do not get expanded after an exception has been thrown
1 parent ad9eaea commit 7f06af6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

‎Parser/pegen/pegen.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ _PyPegen_raise_error(Parser *p, PyObject *errtype, int with_col_number, const ch
389389
Token *t = p->tokens[p->fill - 1];
390390
Py_ssize_t col_number = !with_col_number;
391391
va_list va;
392+
p->error_indicator = 1;
392393

393394
va_start(va, errmsg);
394395
errstr = PyUnicode_FromFormatV(errmsg, va);

0 commit comments

Comments
 (0)