summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1995-01-10 10:34:21 (GMT)
committerGuido van Rossum <guido@python.org>1995-01-10 10:34:21 (GMT)
commit1f97612e643d80e704d75ef108bea2f4a54c79e1 (patch)
treeed8cb0036b187b1509406f7ebd91d3943c7c2a50 /Lib
parent409780f8f27c6c80481d7c6f62eb8bcbd132c47e (diff)
downloadcpython-1f97612e643d80e704d75ef108bea2f4a54c79e1.zip
cpython-1f97612e643d80e704d75ef108bea2f4a54c79e1.tar.gz
cpython-1f97612e643d80e704d75ef108bea2f4a54c79e1.tar.bz2
Fix exec test so presence of __builtins__ doesn't break it
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_grammar.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_grammar.py b/Lib/test/test_grammar.py
index 67baf09..115b5f9 100644
--- a/Lib/test/test_grammar.py
+++ b/Lib/test/test_grammar.py
@@ -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'