mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
bpo-43121: Fix incorrect SyntaxError message for missing comma (GH-24436)
This commit is contained in:
parent
bfe544d2f2
commit
d4e6ed7e5f
4 changed files with 29 additions and 8 deletions
|
@ -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 '}' {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue