summaryrefslogtreecommitdiffstats
path: root/Grammar/python.gram
diff options
context:
space:
mode:
authorPablo Galindo Salgado <Pablogsal@gmail.com>2021-08-18 20:09:21 (GMT)
committerGitHub <noreply@github.com>2021-08-18 20:09:21 (GMT)
commitb2f68b190035540872072ac1d2349e7745e85596 (patch)
treebd130a26b96442cbe45d4b3c397f39ad6faaf057 /Grammar/python.gram
parent31ee985db86c1339d00bd0d3cc1712019460670a (diff)
downloadcpython-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.gram2
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: