[pypy-svn] pypy default: Remove the call_function hook method on space, otherwise it will keep

arigo commits-noreply at bitbucket.org
Wed Dec 29 10:30:52 CET 2010


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r40261:2603a25ba7be
Date: 2010-12-29 10:30 +0100
http://bitbucket.org/pypy/pypy/changeset/2603a25ba7be/

Log:	Remove the call_function hook method on space, otherwise it will
	keep being called on future test runs.

diff --git a/pypy/interpreter/test/test_interpreter.py b/pypy/interpreter/test/test_interpreter.py
--- a/pypy/interpreter/test/test_interpreter.py
+++ b/pypy/interpreter/test/test_interpreter.py
@@ -165,11 +165,14 @@
             assert not arg_w or not space.eq_w(arg_w[-1], space.wrap(-1))
             return real_call_function(w_obj, *arg_w)
         self.space.call_function = safe_call_function
-        code = '''
-            def f():
-                import sys
-            '''
-        self.codetest(code, 'f', [])
+        try:
+            code = '''
+                def f():
+                    import sys
+                '''
+            self.codetest(code, 'f', [])
+        finally:
+            del self.space.call_function
 
     def test_call_star_starstar(self):
         code = '''\


More information about the Pypy-commit mailing list