summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-12-30 19:34:10 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-12-30 19:34:10 (GMT)
commit0f02d3933bff50042dd914d5d17831af7093cf55 (patch)
tree68365aea879cae3caa8b4267e45922ec2fa49c18 /Lib
parentb7953f00b186baee159a2d5dfe1e80ca0ef00a29 (diff)
downloadcpython-0f02d3933bff50042dd914d5d17831af7093cf55.zip
cpython-0f02d3933bff50042dd914d5d17831af7093cf55.tar.gz
cpython-0f02d3933bff50042dd914d5d17831af7093cf55.tar.bz2
check if the attribute is set before deleting it with T_OBJECT_EX (fixes #7604)
Also, add a note to the docs about the better behavior of T_OBJECT_EX as compared to T_OBJECT.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_descr.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py
index 87d30eb..10b5af9 100644
--- a/Lib/test/test_descr.py
+++ b/Lib/test/test_descr.py
@@ -1166,6 +1166,11 @@ order (MRO) for bases """
del h
self.assertEqual(s.getvalue(), '')
+ class X(object):
+ __slots__ = "a"
+ with self.assertRaises(AttributeError):
+ del X().a
+
def test_slots_special(self):
# Testing __dict__ and __weakref__ in __slots__...
class D(object):