[pypy-svn] rev 2325 - pypy/trunk/src/pypy/objspace

rxe at codespeak.net rxe at codespeak.net
Mon Dec 15 16:19:06 CET 2003


Author: rxe
Date: Mon Dec 15 16:19:05 2003
New Revision: 2325

Modified:
   pypy/trunk/src/pypy/objspace/trace.py
Log:
Testing.



Modified: pypy/trunk/src/pypy/objspace/trace.py
==============================================================================
--- pypy/trunk/src/pypy/objspace/trace.py	(original)
+++ pypy/trunk/src/pypy/objspace/trace.py	Mon Dec 15 16:19:05 2003
@@ -4,7 +4,7 @@
 import pypy
 from pypy.objspace.std import StdObjSpace
 from pypy.interpreter.baseobjspace import ObjSpace
-
+from pypy.interpreter.pycode import PyCode
 debug = 0
 
 # ______________________________________________________________________
@@ -23,7 +23,36 @@
                 setattr(self, key, logger)
 
 
-Space = TraceObjSpace
+    def runx(self, func, *args):
+        globals = {}
+            
+        w_globals = self.wrap(globals) 
+        args_w = [self.wrap(ii) for ii in args]
+
+        ec = self.getexecutioncontext()
+
+        code = func.func_code
+        code = PyCode()._from_code(code)
 
+        frame = code.create_frame(space, w_globals)
+        frame.setfastscope(args_w)
+        
+        return frame.run()
+        
+
+Space = TraceObjSpace
+s = Space()
 # ______________________________________________________________________
 # End of trace.py
+
+
+def runx(space, func, *args):
+    globals = {}
+    w_globals = space.wrap(globals) 
+    args_w = [space.wrap(ii) for ii in args]
+    ec = space.getexecutioncontext()
+    code = func.func_code
+    code = PyCode()._from_code(code)
+    frame = code.create_frame(space, w_globals)
+    frame.setfastscope(args_w)
+    return frame.run()


More information about the Pypy-commit mailing list