diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2001-01-19 03:25:56 (GMT) |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2001-01-19 03:25:56 (GMT) |
commit | 047e2c93e29ceaa9d321a6e81e6fa9db830173da (patch) | |
tree | ba389f4ae10757559916325976f6b545a5ae36b0 /Lib | |
parent | c862cf400f90e7ef63fa333d1af141934eb92c59 (diff) | |
download | cpython-047e2c93e29ceaa9d321a6e81e6fa9db830173da.zip cpython-047e2c93e29ceaa9d321a6e81e6fa9db830173da.tar.gz cpython-047e2c93e29ceaa9d321a6e81e6fa9db830173da.tar.bz2 |
add test for SyntaxError on
def f(a):
global a
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_compile.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py index 8905864..dff7758 100644 --- a/Lib/test/test_compile.py +++ b/Lib/test/test_compile.py @@ -1,7 +1,7 @@ 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 |