[pypy-svn] r26395 - pypy/dist/pypy/module/_pickle_support

ericvrp at codespeak.net ericvrp at codespeak.net
Thu Apr 27 06:37:23 CEST 2006


Author: ericvrp
Date: Thu Apr 27 06:37:20 2006
New Revision: 26395

Modified:
   pypy/dist/pypy/module/_pickle_support/__init__.py
   pypy/dist/pypy/module/_pickle_support/maker.py
Log:
(pedronis, ericvrp)
forgot to commit this with the previous checkin


Modified: pypy/dist/pypy/module/_pickle_support/__init__.py
==============================================================================
--- pypy/dist/pypy/module/_pickle_support/__init__.py	(original)
+++ pypy/dist/pypy/module/_pickle_support/__init__.py	Thu Apr 27 06:37:20 2006
@@ -7,5 +7,6 @@
     }
 
     interpleveldefs = {
-	'cell_new': 'maker.cell_new'
+        'cell_new': 'maker.cell_new',
+        'code_new': 'maker.code_new',
     }

Modified: pypy/dist/pypy/module/_pickle_support/maker.py
==============================================================================
--- pypy/dist/pypy/module/_pickle_support/maker.py	(original)
+++ pypy/dist/pypy/module/_pickle_support/maker.py	Thu Apr 27 06:37:20 2006
@@ -1,9 +1,19 @@
 from pypy.interpreter.nestedscope import Cell
+from pypy.interpreter.pycode import PyCode
+from pypy.rpython.objectmodel import instantiate
+from pypy.interpreter.argument import Arguments
+from pypy.interpreter.baseobjspace import ObjSpace
+
 
 #note: for now we don't use the actual value when creating the Cell.
 #      (i.e. we assume it will be handled by __setstate__)
 #      Stackless does use this so it might be needed here as well.
 
 def cell_new(space):
-    return space.wrap(Cell())
+    return space.wrap(instantiate(Cell))
 #cell_new.unwrap_spec = [...]
+
+def code_new(space, __args__):
+    w_codetype = space.gettypeobject(PyCode.typedef)
+    return space.call_args(w_codetype, __args__)
+code_new.unwrap_spec = [ObjSpace, Arguments]
\ No newline at end of file



More information about the Pypy-commit mailing list