summaryrefslogtreecommitdiffstats
path: root/Grammar
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2021-02-03 23:29:26 (GMT)
committerGitHub <noreply@github.com>2021-02-03 23:29:26 (GMT)
commitd4e6ed7e5fb43320ea714d7436bc11667c624d43 (patch)
tree1b7139c3a92eb9de5b91e61b5d5a7e92bed07bd7 /Grammar
parentbfe544d2f2c2e7a7c03a764bed3276a1e27a0f5c (diff)
downloadcpython-d4e6ed7e5fb43320ea714d7436bc11667c624d43.zip
cpython-d4e6ed7e5fb43320ea714d7436bc11667c624d43.tar.gz
cpython-d4e6ed7e5fb43320ea714d7436bc11667c624d43.tar.bz2
bpo-43121: Fix incorrect SyntaxError message for missing comma (GH-24436)
Diffstat (limited to 'Grammar')
-rw-r--r--Grammar/python.gram2
1 files changed, 1 insertions, 1 deletions
diff --git a/Grammar/python.gram b/Grammar/python.gram
index 22f2b41..d1a36f0 100644
--- a/Grammar/python.gram
+++ b/Grammar/python.gram
@@ -694,7 +694,7 @@ invalid_primary:
invalid_comprehension:
| ('[' | '(' | '{') a=starred_expression for_if_clauses {
RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "iterable unpacking cannot be used in comprehension") }
- | ('[' | '{') a=star_named_expression ',' [star_named_expressions] {
+ | ('[' | '{') a=star_named_expression ',' [star_named_expressions] for_if_clauses {
RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "did you forget parentheses around the comprehension target?") }
invalid_dict_comprehension:
| '{' a='**' bitwise_or for_if_clauses '}' {