summaryrefslogtreecommitdiffstats
path: root/Parser/pegen.h
diff options
context:
space:
mode:
authorPablo Galindo Salgado <Pablogsal@gmail.com>2021-12-07 15:23:33 (GMT)
committerGitHub <noreply@github.com>2021-12-07 15:23:33 (GMT)
commitc52141200364898818956a73b955f7c04f634dc8 (patch)
treeb618c83e1f20d8873a447b461a392ac624249682 /Parser/pegen.h
parentf78c229b4ec8621a9b15c6396b6c91518e8975d6 (diff)
downloadcpython-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.h3
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);