summaryrefslogtreecommitdiff
path: root/Lib/test
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2006-05-03 18:18:32 +0000
committerGeorg Brandl <georg@python.org>2006-05-03 18:18:32 +0000
commit1bb62309307fa8a199ef5a53ae0f775dfff4fa3f (patch)
tree55a7f8fafe7e79ea665c2cddd3e0752bef841150 /Lib/test
parent23d9d45482fc3ed67c26418d20f31bfb201db4dd (diff)
downloadcpython-git-1bb62309307fa8a199ef5a53ae0f775dfff4fa3f.tar.gz
Bug #1385040: don't allow "def foo(a=1, b): pass" in the compiler package.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_compiler.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_compiler.py b/Lib/test/test_compiler.py
index 483bc18289..48f1643be8 100644
--- a/Lib/test/test_compiler.py
+++ b/Lib/test/test_compiler.py
@@ -56,6 +56,9 @@ class CompilerTest(unittest.TestCase):
def testYieldExpr(self):
compiler.compile("def g(): yield\n\n", "<string>", "exec")
+ def testDefaultArgs(self):
+ self.assertRaises(SyntaxError, compiler.parse, "def foo(a=1, b): pass")
+
def testLineNo(self):
# Test that all nodes except Module have a correct lineno attribute.
filename = __file__