Kaydet (Commit) 047e2c93 authored tarafından Jeremy Hylton's avatar Jeremy Hylton

add test for SyntaxError on

    def f(a):
        global a
üst c862cf40
from test_support import verbose, TestFailed
if verbose:
print 'Running test on duplicate arguments'
print 'Running tests on argument handling'
try:
exec('def f(a, a): pass')
......@@ -14,3 +14,9 @@ try:
raise TestFailed, "duplicate keyword arguments"
except SyntaxError:
pass
try:
exec('def f(a): global a; a = 1')
raise TestFailed, "variable is global and local"
except SyntaxError:
pass
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment