Disallow function calls like foo(None=1).

Backport from py3k rev. 55708 by Guido.
This commit is contained in:
Georg Brandl 2007-06-07 13:23:24 +00:00
parent ab8e279ba6
commit e06cf4534f
2 changed files with 7 additions and 0 deletions

View file

@ -36,6 +36,9 @@ class TestSpecifics(unittest.TestCase):
def test_syntax_error(self):
self.assertRaises(SyntaxError, compile, "1+*3", "filename", "exec")
def test_none_keyword_arg(self):
self.assertRaises(SyntaxError, compile, "f(None=1)", "<string>", "exec")
def test_duplicate_global_local(self):
try:
exec 'def f(a): global a; a = 1'