diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2023-11-27 19:02:57 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-27 19:02:57 (GMT) |
commit | 698b4b73bc2f6d2de96dac04df5102ac468e02c0 (patch) | |
tree | 3f1ca2e0a7458eec14580162f7888d180ea56ab4 /Parser | |
parent | 7140716c883d8f40716543e827fa396609f39962 (diff) | |
download | cpython-698b4b73bc2f6d2de96dac04df5102ac468e02c0.zip cpython-698b4b73bc2f6d2de96dac04df5102ac468e02c0.tar.gz cpython-698b4b73bc2f6d2de96dac04df5102ac468e02c0.tar.bz2 |
[3.12] gh-112388: Fix an error that was causing the parser to try to overwrite tokenizer errors (GH-112410) (#112466)
gh-112388: Fix an error that was causing the parser to try to overwrite tokenizer errors (GH-112410)
(cherry picked from commit 2c8b19174274c183eb652932871f60570123fe99)
Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Diffstat (limited to 'Parser')
-rw-r--r-- | Parser/pegen_errors.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Parser/pegen_errors.c b/Parser/pegen_errors.c index e832422..c13ba97 100644 --- a/Parser/pegen_errors.c +++ b/Parser/pegen_errors.c @@ -217,6 +217,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); |