summaryrefslogtreecommitdiffstats
path: root/Parser/pegen_errors.c
diff options
context:
space:
mode:
Diffstat (limited to 'Parser/pegen_errors.c')
-rw-r--r--Parser/pegen_errors.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Parser/pegen_errors.c b/Parser/pegen_errors.c
index e2bc3b9..2528d45 100644
--- a/Parser/pegen_errors.c
+++ b/Parser/pegen_errors.c
@@ -219,6 +219,10 @@ exit:
void *
_PyPegen_raise_error(Parser *p, PyObject *errtype, int use_mark, const char *errmsg, ...)
{
+ // Bail out if we already have an error set.
+ if (p->error_indicator && PyErr_Occurred()) {
+ return NULL;
+ }
if (p->fill == 0) {
va_list va;
va_start(va, errmsg);