diff options
-rw-r--r-- | Lib/test/output/test_scope | 1 | ||||
-rw-r--r-- | Lib/test/test_scope.py | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/output/test_scope b/Lib/test/output/test_scope index 5c80b6e5c6..a439e441e6 100644 --- a/Lib/test/output/test_scope +++ b/Lib/test/output/test_scope @@ -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 diff --git a/Lib/test/test_scope.py b/Lib/test/test_scope.py index 85cfed4749..f39bbc2037 100644 --- a/Lib/test/test_scope.py +++ b/Lib/test/test_scope.py @@ -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)() |