follow-up of issue3473: update the compiler package to recognize the new syntax.
diff --git a/Lib/test/test_compiler.py b/Lib/test/test_compiler.py
index 390c469..c7ec50f 100644
--- a/Lib/test/test_compiler.py
+++ b/Lib/test/test_compiler.py
@@ -64,6 +64,15 @@
def testYieldExpr(self):
compiler.compile("def g(): yield\n\n", "<string>", "exec")
+ def testKeywordAfterStarargs(self):
+ def f(*args, **kwargs):
+ self.assertEqual((args, kwargs), ((2,3), {'x': 1, 'y': 4}))
+ c = compiler.compile('f(x=1, *(2, 3), y=4)', '<string>', 'exec')
+ exec c in {'f': f}
+
+ self.assertRaises(SyntaxError, compiler.parse, "foo(a=1, b)")
+ self.assertRaises(SyntaxError, compiler.parse, "foo(1, *args, 3)")
+
def testTryExceptFinally(self):
# Test that except and finally clauses in one try stmt are recognized
c = compiler.compile("try:\n 1/0\nexcept:\n e = 1\nfinally:\n f = 1",