]> granicus.if.org Git - python/commitdiff
Add test for eval() w/ free variables.
authorJeremy Hylton <jeremy@alum.mit.edu>
Sat, 20 Apr 2002 04:51:39 +0000 (04:51 +0000)
committerJeremy Hylton <jeremy@alum.mit.edu>
Sat, 20 Apr 2002 04:51:39 +0000 (04:51 +0000)
Related to SF bug #505315

Lib/test/output/test_scope
Lib/test/test_scope.py

index 5c80b6e5c6d463bd4187ed76617e3f86ba70f82f..a439e441e60aeaf009519badb3e2c19088ee12b7 100644 (file)
@@ -21,3 +21,4 @@ test_scope
 20. interaction with trace function
 20. eval and exec with free variables
 21. list comprehension with local variables
+22. eval with free variables
index 85cfed4749b669024999d915cc57522e40a218a6..f39bbc2037203d041c39fad457f769213c6d814a 100644 (file)
@@ -512,3 +512,13 @@ try:
     print bad
 except NameError:
     pass
+
+print "22. eval with free variables"
+
+def f(x):
+    def g():
+        x
+        eval("x + 1")
+    return g
+
+f(4)()