bpo-44947: Refine the syntax error for trailing commas in import statements (GH-27814)

This commit is contained in:
Pablo Galindo Salgado 2021-08-18 21:09:21 +01:00 committed by GitHub
parent 31ee985db8
commit b2f68b1900
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 6 deletions

View file

@ -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: