mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
bpo-44947: Refine the syntax error for trailing commas in import statements (GH-27814)
This commit is contained in:
parent
31ee985db8
commit
b2f68b1900
4 changed files with 18 additions and 6 deletions
|
@ -1169,7 +1169,7 @@ invalid_group:
|
|||
| '(' a='**' expression ')' {
|
||||
RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "cannot use double starred expression here") }
|
||||
invalid_import_from_targets:
|
||||
| import_from_as_names ',' {
|
||||
| import_from_as_names ',' NEWLINE {
|
||||
RAISE_SYNTAX_ERROR("trailing comma not allowed without surrounding parentheses") }
|
||||
|
||||
invalid_with_stmt:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue