Commit 047e2c93 authored by Jeremy Hylton's avatar Jeremy Hylton

add test for SyntaxError on

    def f(a):
        global a
parent c862cf40
from test_support import verbose, TestFailed from test_support import verbose, TestFailed
if verbose: if verbose:
print 'Running test on duplicate arguments' print 'Running tests on argument handling'
try: try:
exec('def f(a, a): pass') exec('def f(a, a): pass')
...@@ -14,3 +14,9 @@ try: ...@@ -14,3 +14,9 @@ try:
raise TestFailed, "duplicate keyword arguments" raise TestFailed, "duplicate keyword arguments"
except SyntaxError: except SyntaxError:
pass 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