mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
bpo-41064: Improve syntax error for invalid usage of '**' in f-strings (GH-25006)
This commit is contained in:
parent
4958f5d69d
commit
8efad61963
4 changed files with 47 additions and 1 deletions
|
@ -842,6 +842,8 @@ invalid_for_target:
|
|||
invalid_group:
|
||||
| '(' a=starred_expression ')' {
|
||||
RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "can't use starred expression here") }
|
||||
| '(' a='**' expression ')' {
|
||||
RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "can't use double starred expression here") }
|
||||
invalid_import_from_targets:
|
||||
| import_from_as_names ',' {
|
||||
RAISE_SYNTAX_ERROR("trailing comma not allowed without surrounding parentheses") }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue