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
This commit is contained in:
Lysandros Nikolaou 2020-05-04 03:20:09 +03:00 committed by GitHub
parent ad9eaeab74
commit 7f06af684a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -389,6 +389,7 @@ _PyPegen_raise_error(Parser *p, PyObject *errtype, int with_col_number, const ch
Token *t = p->tokens[p->fill - 1];
Py_ssize_t col_number = !with_col_number;
va_list va;
p->error_indicator = 1;
va_start(va, errmsg);
errstr = PyUnicode_FromFormatV(errmsg, va);