Commits

Armin Rigo  committed fd2b374

Fixes

  • Participants
  • Parent commits 5019213
  • Branches kill-someobject

Comments (0)

Files changed (3)

File pypy/annotation/bookkeeper.py

         """Get the ClassDef associated with the given user cls.
         Avoid using this!  It breaks for classes that must be specialized.
         """
-        if cls is object:
-            return None
+        assert cls is not object
         desc = self.getdesc(cls)
         return desc.getuniqueclassdef()
 

File pypy/annotation/model.py

     "Stands for an instance of a (user-defined) class."
 
     def __init__(self, classdef, can_be_None=False, flags={}):
+        assert classdef is not None
         self.classdef = classdef
         self.knowntype = classdef or object
         self.can_be_None = can_be_None

File pypy/rpython/memory/gctransform/test/test_transform.py

     class A:
         def __init__(self, obj):
             self.x = obj
-    def f(v):
+    class B:
+        def __init__(self, i):
+            self.i = i
+    def f(i):
+        v = B(i)
         inst = A(v)
         llop.setfield(lltype.Void, inst, 'x', v)
         llop.bare_setfield(lltype.Void, inst, 'x', v)
 
-    t, transformer = rtype_and_transform(f, [object], _TestGCTransformer,
+    t, transformer = rtype_and_transform(f, [int], _TestGCTransformer,
                                          check=False)
     ops = getops(graphof(t, f))
-    assert len(ops.get('getfield', [])) == 1
+    # xxx no checking done any more