[pypy-svn] pypy commit b750078b8df4: (cfbolz, arigo)

Bitbucket commits-noreply at bitbucket.org
Wed Dec 15 15:48:45 CET 2010


# HG changeset patch -- Bitbucket.org
# Project pypy
# URL http://bitbucket.org/pypy/pypy/overview
# User Armin Rigo <arigo at tunes.org>
# Date 1292424514 -3600
# Node ID b750078b8df4fa93384aadf0785dcfb7a82f4b1e
# Parent  93c72d45e71905dac868fcbf5afb5538a571588e
(cfbolz, arigo)
Try to prevent future breakage due to missing classes in the 'typeorder' dict.
At least, this assert would have shown the issue fixed by 947475d879e6.
(Note that that issue was only visible if builtinshortcut is enabled,
like during translation.)

--- a/pypy/objspace/std/objspace.py
+++ b/pypy/objspace/std/objspace.py
@@ -322,6 +322,14 @@ class StdObjSpace(ObjSpace, DescrOperati
             w_subtype = w_type.check_user_subclass(w_subtype)
             if cls.typedef.applevel_subclasses_base is not None:
                 cls = cls.typedef.applevel_subclasses_base
+            #
+            if not we_are_translated():
+                if issubclass(cls, model.W_Object):
+                    # If cls is missing from model.typeorder, then you
+                    # need to add it there (including the inheritance
+                    # relationship, if any)
+                    assert cls in self.model.typeorder, repr(cls)
+            #
             if (self.config.objspace.std.withmapdict and cls is W_ObjectObject
                     and not w_subtype.needsdel):
                 from pypy.objspace.std.mapdict import get_subclass_of_correct_size



More information about the Pypy-commit mailing list