From: Guido van Rossum Date: Tue, 10 Jan 1995 10:34:21 +0000 (+0000) Subject: Fix exec test so presence of __builtins__ doesn't break it X-Git-Tag: v1.2b1~40 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1f97612e643d80e704d75ef108bea2f4a54c79e1;p=thirdparty%2FPython%2Fcpython.git Fix exec test so presence of __builtins__ doesn't break it --- diff --git a/Lib/test/test_grammar.py b/Lib/test/test_grammar.py index 67baf09fdda8..115b5f95618b 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'