[pypy-svn] r26325 - in pypy/dist/pypy: objspace/cpy/test rpython/rctypes

arigo at codespeak.net arigo at codespeak.net
Tue Apr 25 13:22:16 CEST 2006


Author: arigo
Date: Tue Apr 25 13:22:15 2006
New Revision: 26325

Modified:
   pypy/dist/pypy/objspace/cpy/test/test_compile.py
   pypy/dist/pypy/rpython/rctypes/apyobject.py
Log:
Annotate the trampoline() function with SomeObjects.


Modified: pypy/dist/pypy/objspace/cpy/test/test_compile.py
==============================================================================
--- pypy/dist/pypy/objspace/cpy/test/test_compile.py	(original)
+++ pypy/dist/pypy/objspace/cpy/test/test_compile.py	Tue Apr 25 13:22:15 2006
@@ -42,7 +42,6 @@
     return entrypoint
 
 def test_annotate_bltinfunc():
-    py.test.skip("in-progress")
     entrypoint = maketest()
     t = TranslationContext()
     a = t.buildannotator(policy=CPyAnnotatorPolicy())

Modified: pypy/dist/pypy/rpython/rctypes/apyobject.py
==============================================================================
--- pypy/dist/pypy/rpython/rctypes/apyobject.py	(original)
+++ pypy/dist/pypy/rpython/rctypes/apyobject.py	Tue Apr 25 13:22:15 2006
@@ -1,5 +1,5 @@
 from ctypes import py_object
-from pypy.annotation.model import SomeCTypesObject, SomeImpossibleValue
+from pypy.annotation.model import SomeCTypesObject, SomeObject
 from pypy.rpython.rctypes.implementation import CTypesCallEntry, CTypesObjEntry
 from pypy.rpython.lltypesystem import lltype
 from pypy.tool.uid import Hashable
@@ -23,6 +23,13 @@
     "Annotation and rtyping of py_object instances."
     _type_ = py_object
 
+    def get_field_annotation(self, s_pyobject, fieldname):
+        assert fieldname == "value"
+        # reading the .value field results in an object of
+        # completely unknown type.  This crashes the annotator if
+        # it is not in allow_someobjects mode.
+        return SomeObject()
+
 ##    def object_seen(self, bookkeeper):
 ##        "Called when the annotator sees this py_object."
 ##        # extension: if the py_object instance has a 'builder' attribute,



More information about the Pypy-commit mailing list