summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_scope.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_scope.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_scope.py')
-rw-r--r--Lib/test/test_scope.py15
1 files changed, 3 insertions, 12 deletions
diff --git a/Lib/test/test_scope.py b/Lib/test/test_scope.py
index 98b7ef3..e4e592a 100644
--- a/Lib/test/test_scope.py
+++ b/Lib/test/test_scope.py
@@ -205,15 +205,6 @@ def unoptimized_clash2():
return f
""")
-# XXX could allow this for exec with const argument, but what's the point
-check_syntax("""\
-def error(y):
- exec "a = 1"
- def f(x):
- return x + y
- return f
-""")
-
check_syntax("""\
def f(x):
def g():
@@ -230,7 +221,7 @@ def f():
# and verify a few cases that should work
-exec """
+exec("""
def noproblem1():
from string import *
f = lambda x:x
@@ -245,7 +236,7 @@ def noproblem3():
def f(x):
global y
y = x
-"""
+""")
print "12. lambdas"
@@ -526,7 +517,7 @@ else:
print "eval() should have failed, because code contained free vars"
try:
- exec g.func_code
+ exec(g.func_code)
except TypeError:
pass
else: