diff options
author | Pablo Galindo Salgado <Pablogsal@gmail.com> | 2021-08-18 20:09:21 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-18 20:09:21 (GMT) |
commit | b2f68b190035540872072ac1d2349e7745e85596 (patch) | |
tree | bd130a26b96442cbe45d4b3c397f39ad6faaf057 /Grammar/python.gram | |
parent | 31ee985db86c1339d00bd0d3cc1712019460670a (diff) | |
download | cpython-b2f68b190035540872072ac1d2349e7745e85596.zip cpython-b2f68b190035540872072ac1d2349e7745e85596.tar.gz cpython-b2f68b190035540872072ac1d2349e7745e85596.tar.bz2 |
bpo-44947: Refine the syntax error for trailing commas in import statements (GH-27814)
Diffstat (limited to 'Grammar/python.gram')
-rw-r--r-- | Grammar/python.gram | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Grammar/python.gram b/Grammar/python.gram index b107e47..97114b2 100644 --- a/Grammar/python.gram +++ b/Grammar/python.gram @@ -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: |