mirror of
https://github.com/python/cpython.git
synced 2025-07-29 06:05:00 +00:00
Bug #1385040: don't allow "def foo(a=1, b): pass" in the compiler package.
This commit is contained in:
parent
23d9d45482
commit
1bb6230930
3 changed files with 11 additions and 7 deletions
|
@ -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__
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue