[3.9] bpo-41697: Correctly handle KeywordOrStarred when parsing arguments in the parser (GH-22077) (GH-22079)
(cherry picked from commit 315a61f7a9418d904e0eea14b1f054fac3a90e9f)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
diff --git a/Grammar/python.gram b/Grammar/python.gram
index c9f478c..44d435c 100644
--- a/Grammar/python.gram
+++ b/Grammar/python.gram
@@ -537,7 +537,7 @@
| a=args [','] &')' { a }
| incorrect_arguments
args[expr_ty]:
- | a=','.(starred_expression | named_expression !'=')+ b=[',' k=kwargs {k}] { _PyPegen_collect_call_seqs(p, a, b) }
+ | a=','.(starred_expression | named_expression !'=')+ b=[',' k=kwargs {k}] { _PyPegen_collect_call_seqs(p, a, b, EXTRA) }
| a=kwargs { _Py_Call(_PyPegen_dummy_name(p),
CHECK_NULL_ALLOWED(_PyPegen_seq_extract_starred_exprs(p, a)),
CHECK_NULL_ALLOWED(_PyPegen_seq_delete_starred_exprs(p, a)),