Commits

Alex Gaynor committed 2946d20 Merge

Merged upstream.

  • Participants
  • Parent commits eb35134, 74972a6

Comments (0)

Files changed (2)

pypy/interpreter/typedef.py

         Delete the value of the slot 'member' from the given 'obj'."""
         self = member
         self.typecheck(space, w_obj)
+        w_oldresult = w_obj.getslotvalue(self.index)
+        if w_oldresult is None:
+            raise OperationError(space.w_AttributeError,
+                                 space.wrap(self.name)) # XXX better message
         w_obj.setslotvalue(self.index, None)
 
 Member.typedef = TypeDef(

pypy/objspace/std/test/test_typeobject.py

             __slots__ = ('x',)
         a = A()
         raises(AttributeError, getattr, a, 'x')
+        raises(AttributeError, delattr, a, 'x')
         a.x = 1
         assert a.x == 1
         assert A.__dict__['x'].__get__(a) == 1
         del a.x
         raises(AttributeError, getattr, a, 'x')
+        raises(AttributeError, delattr, a, 'x')
         class B(A):
             pass
         b = B()
         raises(AttributeError, getattr, b, 'x')
+        raises(AttributeError, delattr, b, 'x')
         b.x = 1
         assert b.x == 1
         assert A.__dict__['x'].__get__(b) == 1
         del b.x
         raises(AttributeError, getattr, b, 'x')
+        raises(AttributeError, delattr, b, 'x')
         class Z(object):
             pass
         z = Z()