From 1f97612e643d80e704d75ef108bea2f4a54c79e1 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Tue, 10 Jan 1995 10:34:21 +0000 Subject: Fix exec test so presence of __builtins__ doesn't break it --- Lib/test/test_grammar.py | 3 +++ 1 file changed, 3 insertions(+) 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' -- cgit v0.12