[pypy-commit] pypy kill-multimethod: Fix ztranslation tests by not looking into typedefs of builtin types.

Manuel Jacob noreply at buildbot.pypy.org
Thu Feb 27 14:54:24 CET 2014


Author: Manuel Jacob
Branch: kill-multimethod
Changeset: r69514:8588a1b129f6
Date: 2014-02-27 14:53 +0100
http://bitbucket.org/pypy/pypy/changeset/8588a1b129f6/

Log:	Fix ztranslation tests by not looking into typedefs of builtin
	types.

diff --git a/pypy/objspace/fake/objspace.py b/pypy/objspace/fake/objspace.py
--- a/pypy/objspace/fake/objspace.py
+++ b/pypy/objspace/fake/objspace.py
@@ -107,6 +107,10 @@
 # ____________________________________________________________
 
 
+BUILTIN_TYPES = ['int', 'str', 'float', 'long', 'tuple', 'list', 'dict',
+                 'unicode', 'complex', 'slice', 'bool', 'basestring', 'object',
+                 'bytearray']
+
 class FakeObjSpace(ObjSpace):
     def __init__(self, config=None):
         self._seen_extras = []
@@ -331,9 +335,7 @@
     def setup(space):
         for name in (ObjSpace.ConstantTable +
                      ObjSpace.ExceptionTable +
-                     ['int', 'str', 'float', 'long', 'tuple', 'list',
-                      'dict', 'unicode', 'complex', 'slice', 'bool',
-                      'basestring', 'object', 'bytearray']):
+                     BUILTIN_TYPES):
             setattr(space, 'w_' + name, w_some_obj())
         space.w_type = w_some_type()
         #
@@ -364,8 +366,9 @@
 @specialize.memo()
 def see_typedef(space, typedef):
     assert isinstance(typedef, TypeDef)
-    for name, value in typedef.rawdict.items():
-        space.wrap(value)
+    if typedef.name not in BUILTIN_TYPES:
+        for name, value in typedef.rawdict.items():
+            space.wrap(value)
 
 class FakeCompiler(object):
     pass


More information about the pypy-commit mailing list