diff options
author | Pablo Galindo Salgado <Pablogsal@gmail.com> | 2021-12-07 13:02:15 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-07 13:02:15 (GMT) |
commit | 1c7a1c3be08ee911d347fffd2716f3911ba751f9 (patch) | |
tree | 1676eca102b29d3abb4fa6162b75e28a5c937a59 /Parser | |
parent | cf7eaa4617295747ee5646c4e2b7e7a16d7c64ab (diff) | |
download | cpython-1c7a1c3be08ee911d347fffd2716f3911ba751f9.zip cpython-1c7a1c3be08ee911d347fffd2716f3911ba751f9.tar.gz cpython-1c7a1c3be08ee911d347fffd2716f3911ba751f9.tar.bz2 |
bpo-46004: Fix error location for loops with invalid targets (GH-29959)
Diffstat (limited to 'Parser')
-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 78e75d7..caba34e 100644 --- a/Parser/pegen.h +++ b/Parser/pegen.h @@ -227,8 +227,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; } // Action utility functions |