Commits

Armin Rigo committed bb4ebc0

Not super happy with super_invoke_finalizer in mapdict. It feels like
hacking until it works.

  • Participants
  • Parent commits e3628e6
  • Branches gc-del

Comments (0)

Files changed (2)

pypy/interpreter/typedef.py

                     value = func_with_new_name(value, value.func_name)
                 body[key] = value
 
+    super_invoke_finalizer = supercls.invoke_finalizer.im_func
+    if super_invoke_finalizer == W_Root.invoke_finalizer.im_func:
+        super_invoke_finalizer = lambda self: None
+
     if (config.objspace.std.withmapdict and "dict" in features):
         from pypy.objspace.std.mapdict import BaseMapdictObject, ObjectMixin
         add(BaseMapdictObject)
         add(ObjectMixin)
         body["user_overridden_class"] = True
+        body["_super_invoke_finalizer"] = super_invoke_finalizer
+        assert not hasattr(supercls, '_super_invoke_finalizer')
         features = ()
 
     if "user" in features:     # generic feature needed by all subcls
 
-        super_invoke_finalizer = supercls.invoke_finalizer.im_func
-        if super_invoke_finalizer == W_Root.invoke_finalizer.im_func:
-            super_invoke_finalizer = lambda self: None
-
         class Proto(object):
             user_overridden_class = True
 

pypy/objspace/std/mapdict.py

         self.map = map
 
 class Object(ObjectMixin, BaseMapdictObject, W_Root):
-    pass # mainly for tests
+    # mainly for tests
+    _super_invoke_finalizer = lambda self: None
 
 def get_subclass_of_correct_size(space, cls, w_type):
     assert space.config.objspace.std.withmapdict