summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_grammar.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2006-09-06 06:51:57 (GMT)
committerGeorg Brandl <georg@python.org>2006-09-06 06:51:57 (GMT)
commit7cae87ca7b0a3a7ce497cbd335c8ec82fe680476 (patch)
tree612cc46e728bef49b19f3d4bc26fa4951b2c1c83 /Lib/test/test_grammar.py
parent4e472e05bdddde72d91d6f25d6e048371cf3c9be (diff)
downloadcpython-7cae87ca7b0a3a7ce497cbd335c8ec82fe680476.zip
cpython-7cae87ca7b0a3a7ce497cbd335c8ec82fe680476.tar.gz
cpython-7cae87ca7b0a3a7ce497cbd335c8ec82fe680476.tar.bz2
Patch #1550800: make exec a function.
Diffstat (limited to 'Lib/test/test_grammar.py')
-rw-r--r--Lib/test/test_grammar.py36
1 files changed, 0 insertions, 36 deletions
diff --git a/Lib/test/test_grammar.py b/Lib/test/test_grammar.py
index 93dc9ec..6e9b204 100644
--- a/Lib/test/test_grammar.py
+++ b/Lib/test/test_grammar.py
@@ -449,42 +449,6 @@ def f():
global a, b
global one, two, three, four, five, six, seven, eight, nine, ten
-print 'exec_stmt' # 'exec' expr ['in' expr [',' expr]]
-def f():
- z = None
- del z
- exec 'z=1+1\n'
- if z != 2: raise TestFailed, 'exec \'z=1+1\'\\n'
- del z
- exec 'z=1+1'
- if z != 2: raise TestFailed, 'exec \'z=1+1\''
- z = None
- del z
- import types
- if hasattr(types, "UnicodeType"):
- exec r"""if 1:
- exec u'z=1+1\n'
- if z != 2: raise TestFailed, 'exec u\'z=1+1\'\\n'
- del z
- exec u'z=1+1'
- if z != 2: raise TestFailed, 'exec u\'z=1+1\''
-"""
-f()
-g = {}
-exec 'z = 1' in g
-if '__builtins__' in g: del g['__builtins__']
-if g != {'z': 1}: raise TestFailed, 'exec \'z = 1\' in g'
-g = {}
-l = {}
-
-import warnings
-warnings.filterwarnings("ignore", "global statement", module="<string>")
-exec 'global a; a = 1; b = 2' in g, l
-if '__builtins__' in g: del g['__builtins__']
-if '__builtins__' in l: del l['__builtins__']
-if (g, l) != ({'a':1}, {'b':2}): raise TestFailed, 'exec ... in g (%s), l (%s)' %(g,l)
-
-
print "assert_stmt" # assert_stmt: 'assert' test [',' test]
assert 1
assert 1, 1