[pypy-svn] r11975 - pypy/dist/pypy/translator

pedronis at codespeak.net pedronis at codespeak.net
Thu May 5 19:14:36 CEST 2005


Author: pedronis
Date: Thu May  5 19:14:36 2005
New Revision: 11975

Modified:
   pypy/dist/pypy/translator/ann_override.py
Log:
annotation override for the code invoke host CPython compile, this should be special cased when translating



Modified: pypy/dist/pypy/translator/ann_override.py
==============================================================================
--- pypy/dist/pypy/translator/ann_override.py	(original)
+++ pypy/dist/pypy/translator/ann_override.py	Thu May  5 19:14:36 2005
@@ -7,6 +7,8 @@
 from pypy.objspace.std import fake
 from pypy.module.sys2 import state as sys_state
 import pypy.interpreter.typedef as itypedef
+import pypy.interpreter.pycode as pycode
+import pypy.interpreter.compiler as icompiler
 from pypy.objspace.std.objspace import StdObjSpace
 
 def ignore(*args):
@@ -32,6 +34,10 @@
     clsdef = getbookkeeper().getclassdef(itypedef.W_Root)
     return annmodel.SomeInstance(clsdef)    
 
+def cpy_compile(self, source, filename, mode, flags):
+    clsdef = getbookkeeper().getclassdef(pycode.PyCode)
+    return annmodel.SomeInstance(clsdef)    
+
 pypy_overrides = {}
 
 def install(tgt, override):
@@ -46,3 +52,4 @@
 install(fake.fake_object, fake_object)
 install(itypedef.instantiate, instantiate)
 install(StdObjSpace.wrap_exception_cls, wrap_exception_cls)
+install(icompiler.CPythonCompiler.compile, cpy_compile)



More information about the Pypy-commit mailing list