We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent af61c31 commit 7a6fcf1Copy full SHA for 7a6fcf1
1 file changed
Grammar/python.gram
@@ -1447,8 +1447,8 @@ invalid_import_from_targets:
1447
RAISE_SYNTAX_ERROR_STARTING_FROM(token, "Expected one or more names after 'import'") }
1448
1449
invalid_with_stmt:
1450
- | ['async'] 'with' expression ['as' star_target] ',' ':' {
1451
- RAISE_SYNTAX_ERROR("single 'with' item has a trailing comma") }
+ | ['async'] 'with' ','.(expression ['as' star_target])+ trailing=',' ':' {
+ RAISE_SYNTAX_ERROR_KNOWN_LOCATION(trailing, "the last 'with' item has a trailing comma") }
1452
| ['async'] 'with' ','.(expression ['as' star_target])+ NEWLINE { RAISE_SYNTAX_ERROR("expected ':'") }
1453
| ['async'] 'with' '(' ','.(expressions ['as' star_target])+ ','? ')' NEWLINE { RAISE_SYNTAX_ERROR("expected ':'") }
1454
invalid_with_stmt_indent:
0 commit comments