https://github.com/python/cpython/commit/7f06af684a1882fdb19d20650825948b1d7... commit: 7f06af684a1882fdb19d20650825948b1d7996e5 branch: master author: Lysandros Nikolaou <lisandrosnik@gmail.com> committer: GitHub <noreply@github.com> date: 2020-05-04T01:20:09+01:00 summary: 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 files: M Parser/pegen/pegen.c diff --git a/Parser/pegen/pegen.c b/Parser/pegen/pegen.c index 6ff09b3b31f78..9858f71c83c79 100644 --- a/Parser/pegen/pegen.c +++ b/Parser/pegen/pegen.c @@ -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);