summaryrefslogtreecommitdiffstats
path: root/Grammar
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2021-03-24 19:34:17 (GMT)
committerGitHub <noreply@github.com>2021-03-24 19:34:17 (GMT)
commit8efad61963809d239cac986e3f3bc4cb505ab8fe (patch)
treec1d2c56b72ad7e1ee034f481570449267f73a85a /Grammar
parent4958f5d69dd2bf86866c43491caf72f774ddec97 (diff)
downloadcpython-8efad61963809d239cac986e3f3bc4cb505ab8fe.zip
cpython-8efad61963809d239cac986e3f3bc4cb505ab8fe.tar.gz
cpython-8efad61963809d239cac986e3f3bc4cb505ab8fe.tar.bz2
bpo-41064: Improve syntax error for invalid usage of '**' in f-strings (GH-25006)
Diffstat (limited to 'Grammar')
-rw-r--r--Grammar/python.gram2
1 files changed, 2 insertions, 0 deletions
diff --git a/Grammar/python.gram b/Grammar/python.gram
index 7247962..4f3b649 100644
--- a/Grammar/python.gram
+++ b/Grammar/python.gram
@@ -842,6 +842,8 @@ invalid_for_target:
invalid_group:
| '(' a=starred_expression ')' {
RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "can't use starred expression here") }
+ | '(' a='**' expression ')' {
+ RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "can't use double starred expression here") }
invalid_import_from_targets:
| import_from_as_names ',' {
RAISE_SYNTAX_ERROR("trailing comma not allowed without surrounding parentheses") }