summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_descr.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-04-25 00:41:22 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-04-25 00:41:22 (GMT)
commit5083dc552b4e7026c2f405b37d7691131bc96955 (patch)
treea8ae47a8e0a88ae2a37add5c89a06d291490cc5e /Lib/test/test_descr.py
parent5c6af808f7721787dcce1bc6bfe14f225f9db6f3 (diff)
downloadcpython-5083dc552b4e7026c2f405b37d7691131bc96955.zip
cpython-5083dc552b4e7026c2f405b37d7691131bc96955.tar.gz
cpython-5083dc552b4e7026c2f405b37d7691131bc96955.tar.bz2
fix a segfault when setting __class__ in __del__ #5283
Diffstat (limited to 'Lib/test/test_descr.py')
-rw-r--r--Lib/test/test_descr.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py
index 05b4486..ae22af7 100644
--- a/Lib/test/test_descr.py
+++ b/Lib/test/test_descr.py
@@ -3003,6 +3003,16 @@ order (MRO) for bases """
continue
cant(cls(), cls2)
+ # Issue5283: when __class__ changes in __del__, the wrong
+ # type gets DECREF'd.
+ class O(object):
+ pass
+ class A(object):
+ def __del__(self):
+ self.__class__ = O
+ l = [A() for x in range(100)]
+ del l
+
def test_set_dict(self):
# Testing __dict__ assignment...
class C(object): pass