]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Test for the bug in recurse_down_subclasses() that I just fixed.
authorGuido van Rossum <guido@python.org>
Fri, 14 Jun 2002 02:37:00 +0000 (02:37 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 14 Jun 2002 02:37:00 +0000 (02:37 +0000)
Lib/test/test_descr.py

index 5ef3f8c41a496e8458979257de7696471ed177ec..a526ad4769ff9aeb4aba31ed5b228f6fe6b672ee 100644 (file)
@@ -2705,6 +2705,16 @@ def subclasspropagation():
     else:
         raise TestFailed, "d.foo should be undefined now"
 
+    # Test a nasty bug in recurse_down_subclasses()
+    import gc
+    class A(object):
+        pass
+    class B(A):
+        pass
+    del B
+    gc.collect()
+    A.__setitem__ = lambda *a: None # crash
+
 def buffer_inherit():
     import binascii
     # SF bug [#470040] ParseTuple t# vs subclasses.