bpo-41064: Improve syntax error for invalid usage of '**' in f-strings (GH-25006)
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_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") }