summaryrefslogtreecommitdiffstats
path: root/Parser
diff options
context:
space:
mode:
authorPablo Galindo Salgado <Pablogsal@gmail.com>2023-11-27 18:36:11 (GMT)
committerGitHub <noreply@github.com>2023-11-27 18:36:11 (GMT)
commit2c8b19174274c183eb652932871f60570123fe99 (patch)
treeb2b7b1ad193e1aa8f8cae9b2b62437e65e71a658 /Parser
parent967f2a3052c2d22e31564b428a9aa8cc63dc2a9f (diff)
downloadcpython-2c8b19174274c183eb652932871f60570123fe99.zip
cpython-2c8b19174274c183eb652932871f60570123fe99.tar.gz
cpython-2c8b19174274c183eb652932871f60570123fe99.tar.bz2
gh-112388: Fix an error that was causing the parser to try to overwrite tokenizer errors (#112410)
Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
Diffstat (limited to 'Parser')
-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);