mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Fix exec test so presence of __builtins__ doesn't break it
This commit is contained in:
parent
409780f8f2
commit
1f97612e64
1 changed files with 3 additions and 0 deletions
|
@ -283,10 +283,13 @@ def f():
|
|||
f()
|
||||
g = {}
|
||||
exec 'z = 1' in g
|
||||
if g.has_key('__builtins__'): del g['__builtins__']
|
||||
if g <> {'z': 1}: raise TestFailed, 'exec \'z = 1\' in g'
|
||||
g = {}
|
||||
l = {}
|
||||
exec 'global a; a = 1; b = 2' in g, l
|
||||
if g.has_key('__builtins__'): del g['__builtins__']
|
||||
if l.has_key('__builtins__'): del l['__builtins__']
|
||||
if (g, l) <> ({'a':1}, {'b':2}): raise TestFailed, 'exec ... in g, l'
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue