summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_scope.py
diff options
context:
space:
mode:
authorNeil Schemenauer <nascheme@enme.ucalgary.ca>2006-07-09 16:16:34 (GMT)
committerNeil Schemenauer <nascheme@enme.ucalgary.ca>2006-07-09 16:16:34 (GMT)
commit0e07b60a4e44129cfafaeacac765cf957e2ea219 (patch)
treebf67b1a4f4302118d38e3c57ddd91f20da8b1d99 /Lib/test/test_scope.py
parent63597f129d73ddcfc2f3adc99d0d84d1da91082e (diff)
downloadcpython-0e07b60a4e44129cfafaeacac765cf957e2ea219.zip
cpython-0e07b60a4e44129cfafaeacac765cf957e2ea219.tar.gz
cpython-0e07b60a4e44129cfafaeacac765cf957e2ea219.tar.bz2
Fix AST compiler bug #1501934: incorrect LOAD/STORE_GLOBAL generation.
Diffstat (limited to 'Lib/test/test_scope.py')
-rw-r--r--Lib/test/test_scope.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_scope.py b/Lib/test/test_scope.py
index f37254c..239745c 100644
--- a/Lib/test/test_scope.py
+++ b/Lib/test/test_scope.py
@@ -299,6 +299,17 @@ except NameError:
else:
raise TestFailed
+# test for bug #1501934: incorrect LOAD/STORE_GLOBAL generation
+global_x = 1
+def f():
+ global_x += 1
+try:
+ f()
+except UnboundLocalError:
+ pass
+else:
+ raise TestFailed, 'scope of global_x not correctly determined'
+
print "14. complex definitions"
def makeReturner(*lst):