summaryrefslogtreecommitdiff
path: root/Grammar/python.gram
diff options
context:
space:
mode:
authorPablo Galindo Salgado <Pablogsal@gmail.com>2021-08-18 21:09:21 +0100
committerGitHub <noreply@github.com>2021-08-18 22:09:21 +0200
commitb2f68b190035540872072ac1d2349e7745e85596 (patch)
treebd130a26b96442cbe45d4b3c397f39ad6faaf057 /Grammar/python.gram
parent31ee985db86c1339d00bd0d3cc1712019460670a (diff)
downloadcpython-git-b2f68b190035540872072ac1d2349e7745e85596.tar.gz
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.gram2
1 files changed, 1 insertions, 1 deletions
diff --git a/Grammar/python.gram b/Grammar/python.gram
index b107e47463..97114b20f5 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: