From: Lysandros Nikolaou Date: Mon, 4 May 2020 00:20:09 +0000 (+0300) Subject: bpo-40334: Set error_indicator in _PyPegen_raise_error (GH-19887) X-Git-Tag: v3.9.0b1~195 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7f06af684a1882fdb19d20650825948b1d7996e5;p=thirdparty%2FPython%2Fcpython.git 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 --- diff --git a/Parser/pegen/pegen.c b/Parser/pegen/pegen.c index 6ff09b3b31f7..9858f71c83c7 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);