aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2021-02-03 23:29:26 +0000
committerGitHub <noreply@github.com>2021-02-03 23:29:26 +0000
commitd4e6ed7e5fb43320ea714d7436bc11667c624d43 (patch)
tree1b7139c3a92eb9de5b91e61b5d5a7e92bed07bd7 /Grammar
parentFix typo (GH-23019) (diff)
downloadcpython-d4e6ed7e5fb43320ea714d7436bc11667c624d43.tar.gz
cpython-d4e6ed7e5fb43320ea714d7436bc11667c624d43.tar.bz2
cpython-d4e6ed7e5fb43320ea714d7436bc11667c624d43.zip
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 22f2b41b11..d1a36f0e4d 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 '}' {