[pypy-svn] r28541 - in pypy/dist/pypy/rpython/ootypesystem: . test

fijal at codespeak.net fijal at codespeak.net
Thu Jun 8 17:35:18 CEST 2006


Author: fijal
Date: Thu Jun  8 17:35:18 2006
New Revision: 28541

Modified:
   pypy/dist/pypy/rpython/ootypesystem/bltregistry.py
   pypy/dist/pypy/rpython/ootypesystem/test/test_bltann.py
Log:
Fixed global issue, added test.


Modified: pypy/dist/pypy/rpython/ootypesystem/bltregistry.py
==============================================================================
--- pypy/dist/pypy/rpython/ootypesystem/bltregistry.py	(original)
+++ pypy/dist/pypy/rpython/ootypesystem/bltregistry.py	Thu Jun  8 17:35:18 2006
@@ -73,6 +73,12 @@
 ##
 ##ExternalInstanceSingleton = ExternalInstance()
 
+class Entry_basicexternalmeta(ExtRegistryEntry):
+    _metatype_ = BasicMetaExternal    
+    
+    def compute_annotation(self):
+        return annmodel.SomeOOInstance(ootype=ExternalType.get(self.instance))
+
 class Entry_basicexternal(ExtRegistryEntry):
     _type_ = BasicExternal.__metaclass__
     

Modified: pypy/dist/pypy/rpython/ootypesystem/test/test_bltann.py
==============================================================================
--- pypy/dist/pypy/rpython/ootypesystem/test/test_bltann.py	(original)
+++ pypy/dist/pypy/rpython/ootypesystem/test/test_bltann.py	Thu Jun  8 17:35:18 2006
@@ -8,6 +8,7 @@
 import exceptions
 from pypy.rpython.ootypesystem.bltregistry import BasicExternal, ExternalType
 from pypy.rpython.ootypesystem.ootype import Signed
+from pypy.rpython.test.test_llinterp import interpret
 
 class C(BasicExternal):
     pass
@@ -53,3 +54,13 @@
     a = RPythonAnnotator()
     s = a.build_types(access_meth, [])
     assert s.knowntype is int
+
+glob_b = B()
+
+def test_global():
+    def access_global():
+        return glob_b.a
+    
+    a = RPythonAnnotator()
+    s = a.build_types(access_global, [])
+    assert s.knowntype is int



More information about the Pypy-commit mailing list