summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2003-05-29 14:26:57 (GMT)
committerGuido van Rossum <guido@python.org>2003-05-29 14:26:57 (GMT)
commitaabe0b3e343dc2b169d72d6a62ee6b624d34134f (patch)
tree7aad7b3b32307e791385a8ee04397c9aa0a5728a
parentb25a52aac09b725dac76013dfafa60093fb2b576 (diff)
downloadcpython-aabe0b3e343dc2b169d72d6a62ee6b624d34134f.zip
cpython-aabe0b3e343dc2b169d72d6a62ee6b624d34134f.tar.gz
cpython-aabe0b3e343dc2b169d72d6a62ee6b624d34134f.tar.bz2
Add testcase for SF 742911.
-rw-r--r--Lib/test/test_descr.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py
index 972e224..3a7f813 100644
--- a/Lib/test/test_descr.py
+++ b/Lib/test/test_descr.py
@@ -3871,8 +3871,32 @@ def carloverre():
else:
raise TestFailed, "Carlo Verre __delattr__ succeeded!"
+def weakref_segfault():
+ # SF 742911
+ if verbose:
+ print "Testing weakref segfault..."
+
+ import weakref
+
+ class Provoker:
+ def __init__(self, referrent):
+ self.ref = weakref.ref(referrent)
+
+ def __del__(self):
+ x = self.ref()
+ print x
+ return x
+
+ class Oops(object):
+ pass
+
+ o = Oops()
+ o.whatever = Provoker(o)
+ del o
+
def test_main():
+ weakref_segfault() # Must be first, somehow
do_this_first()
class_docstrings()
lists()