mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
gh-113602: Bail out when the parser tries to override existing errors (#113607)
Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
This commit is contained in:
parent
8ff44f8554
commit
9ed36d533a
3 changed files with 8 additions and 0 deletions
|
@ -311,6 +311,10 @@ _PyPegen_raise_error_known_location(Parser *p, PyObject *errtype,
|
|||
Py_ssize_t end_lineno, Py_ssize_t end_col_offset,
|
||||
const char *errmsg, va_list va)
|
||||
{
|
||||
// Bail out if we already have an error set.
|
||||
if (p->error_indicator && PyErr_Occurred()) {
|
||||
return NULL;
|
||||
}
|
||||
PyObject *value = NULL;
|
||||
PyObject *errstr = NULL;
|
||||
PyObject *error_line = NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue