mirror of
https://github.com/python/cpython.git
synced 2025-07-30 22:54:16 +00:00
Fix AST compiler bug #1501934: incorrect LOAD/STORE_GLOBAL generation.
This commit is contained in:
parent
63597f129d
commit
0e07b60a4e
5 changed files with 20 additions and 4 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue