[pypy-svn] r9291 - in pypy/branch/dist-interpapp/pypy/interpreter: . test

hpk at codespeak.net hpk at codespeak.net
Thu Feb 17 19:42:27 CET 2005


Author: hpk
Date: Thu Feb 17 19:42:26 2005
New Revision: 9291

Modified:
   pypy/branch/dist-interpapp/pypy/interpreter/gateway.py
   pypy/branch/dist-interpapp/pypy/interpreter/test/test_function.py
Log:
fixed the applevel tests to properly construct Functions 
with w_globals as dicts. 

removed some dead code from interp2papp 


Modified: pypy/branch/dist-interpapp/pypy/interpreter/gateway.py
==============================================================================
--- pypy/branch/dist-interpapp/pypy/interpreter/gateway.py	(original)
+++ pypy/branch/dist-interpapp/pypy/interpreter/gateway.py	Thu Feb 17 19:42:26 2005
@@ -409,9 +409,6 @@
                 defs_w.append(space.wrap(val))
         return defs_w
 
-    def _getglobals(self, space):
-        return None
-
     # lazy binding to space
 
     def __spacebind__(self, space):
@@ -450,7 +447,7 @@
         except KeyError: 
             defs = self._getdefaults(space)  # needs to be implemented by subclass
             code = self._code
-            fn = Function(space, code, self._getglobals(space), defs, forcename = self.name)
+            fn = Function(space, code, None, defs, forcename = self.name)
             cache.content[self] = fn 
             return fn
 

Modified: pypy/branch/dist-interpapp/pypy/interpreter/test/test_function.py
==============================================================================
--- pypy/branch/dist-interpapp/pypy/interpreter/test/test_function.py	(original)
+++ pypy/branch/dist-interpapp/pypy/interpreter/test/test_function.py	Thu Feb 17 19:42:26 2005
@@ -176,7 +176,7 @@
         def c(self, bar):
             return bar
         code = PyCode(self.space)._from_code(c.func_code)
-        self.fn = Function(self.space, code)
+        self.fn = Function(self.space, code, self.space.newdict([]))
         
     def test_get(self):
         space = self.space
@@ -202,7 +202,8 @@
         space = self.space
         # Create some function for this test only
         def m(self): return self
-        func = Function(space, PyCode(self.space)._from_code(m.func_code))
+        func = Function(space, PyCode(self.space)._from_code(m.func_code),
+                        space.newdict([]))
         # Some shorthands
         obj1 = space.wrap(23)
         obj2 = space.wrap(42)



More information about the Pypy-commit mailing list