diff options
author | Pablo Galindo Salgado <Pablogsal@gmail.com> | 2021-12-07 15:23:33 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-07 15:23:33 (GMT) |
commit | c52141200364898818956a73b955f7c04f634dc8 (patch) | |
tree | b618c83e1f20d8873a447b461a392ac624249682 /Parser/pegen.h | |
parent | f78c229b4ec8621a9b15c6396b6c91518e8975d6 (diff) | |
download | cpython-c52141200364898818956a73b955f7c04f634dc8.zip cpython-c52141200364898818956a73b955f7c04f634dc8.tar.gz cpython-c52141200364898818956a73b955f7c04f634dc8.tar.bz2 |
[3.10] bpo-46004: Fix error location for loops with invalid targets (GH-29959). (GH-29961)
(cherry picked from commit 1c7a1c3be08ee911d347fffd2716f3911ba751f9)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Diffstat (limited to 'Parser/pegen.h')
-rw-r--r-- | Parser/pegen.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Parser/pegen.h b/Parser/pegen.h index 04c7b9d..29d4805 100644 --- a/Parser/pegen.h +++ b/Parser/pegen.h @@ -321,8 +321,9 @@ _RAISE_SYNTAX_ERROR_INVALID_TARGET(Parser *p, TARGETS_TYPE type, void *e) msg, _PyPegen_get_expr_name(invalid_target) ); + return RAISE_SYNTAX_ERROR_KNOWN_LOCATION(invalid_target, "invalid syntax"); } - return RAISE_SYNTAX_ERROR("invalid syntax"); + return NULL; } void *_PyPegen_arguments_parsing_error(Parser *, expr_ty); |