Fix AST compiler bug #1501934: incorrect LOAD/STORE_GLOBAL generation.

This commit is contained in:
Neil Schemenauer 2006-07-09 16:16:34 +00:00
parent 63597f129d
commit 0e07b60a4e
5 changed files with 20 additions and 4 deletions

View file

@ -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):