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

arigo at codespeak.net arigo at codespeak.net
Tue Apr 25 13:26:18 CEST 2006


Author: arigo
Date: Tue Apr 25 13:26:17 2006
New Revision: 26326

Modified:
   pypy/dist/pypy/objspace/cpy/test/test_compile.py
   pypy/dist/pypy/rpython/rctypes/rpyobject.py
Log:
Actually, genc is happy with this right out of the box.


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:26:17 2006
@@ -57,7 +57,6 @@
     assert s.knowntype == CPyObjSpace.W_Object
 
 def test_compile_bltinfunc():
-    py.test.skip("in-progress")
     entrypoint = maketest()
     fn = compile(entrypoint, [int],
                  annotatorpolicy = CPyAnnotatorPolicy())

Modified: pypy/dist/pypy/rpython/rctypes/rpyobject.py
==============================================================================
--- pypy/dist/pypy/rpython/rctypes/rpyobject.py	(original)
+++ pypy/dist/pypy/rpython/rctypes/rpyobject.py	Tue Apr 25 13:26:17 2006
@@ -12,7 +12,13 @@
             value = value.value
         p.c_data[0] = lltype.pyobjectptr(value)
 
-    # reading .value is not allowed, as it can't be annotated!
+    def rtype_getattr(self, hop):
+        # only for 'allow_someobjects' annotations
+        s_attr = hop.args_s[1]
+        assert s_attr.is_constant()
+        assert s_attr.const == 'value'
+        v_pyobj = hop.inputarg(self, 0)
+        return self.getvalue(hop.llops, v_pyobj)
 
     def rtype_setattr(self, hop):
         s_attr = hop.args_s[1]



More information about the Pypy-commit mailing list