Kaydet (Commit) 1f97612e authored tarafından Guido van Rossum's avatar Guido van Rossum

Fix exec test so presence of __builtins__ doesn't break it

üst 409780f8
...@@ -283,10 +283,13 @@ def f(): ...@@ -283,10 +283,13 @@ def f():
f() f()
g = {} g = {}
exec 'z = 1' in 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' if g <> {'z': 1}: raise TestFailed, 'exec \'z = 1\' in g'
g = {} g = {}
l = {} l = {}
exec 'global a; a = 1; b = 2' in 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' if (g, l) <> ({'a':1}, {'b':2}): raise TestFailed, 'exec ... in g, l'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment