[pypy-svn] r49634 - pypy/dist/pypy/objspace/std

arigo at codespeak.net arigo at codespeak.net
Tue Dec 11 17:56:25 CET 2007


Author: arigo
Date: Tue Dec 11 17:56:24 2007
New Revision: 49634

Modified:
   pypy/dist/pypy/objspace/std/typeobject.py
Log:
Fix test_typeobject by moving the check for withtypeversion in mutated()
instead of in each caller.


Modified: pypy/dist/pypy/objspace/std/typeobject.py
==============================================================================
--- pypy/dist/pypy/objspace/std/typeobject.py	(original)
+++ pypy/dist/pypy/objspace/std/typeobject.py	Tue Dec 11 17:56:24 2007
@@ -221,7 +221,8 @@
 
     def mutated(w_self):
         space = w_self.space
-        assert space.config.objspace.std.withtypeversion
+        if not space.config.objspace.std.withtypeversion:
+            return
         if w_self.version_tag is not None:
             w_self.version_tag = VersionTag()
             subclasses_w = w_self.get_subclasses()
@@ -529,8 +530,7 @@
     # Note. This is exactly the same thing as descroperation.descr__setattr__,
     # but it is needed at bootstrap to avoid a call to w_type.getdict() which
     # would un-lazify the whole type.
-    if space.config.objspace.std.withtypeversion:
-        w_type.mutated()
+    w_type.mutated()
     name = space.str_w(w_name)
     w_descr = space.lookup(w_type, name)
     if w_descr is not None:
@@ -544,8 +544,7 @@
     w_type.dict_w[name] = w_value
 
 def delattr__Type_ANY(space, w_type, w_name):
-    if space.config.objspace.std.withtypeversion:
-        w_type.mutated()
+    w_type.mutated()
     if w_type.lazyloaders:
         w_type._freeze_()    # force un-lazification
     name = space.str_w(w_name)



More information about the Pypy-commit mailing list