summaryrefslogtreecommitdiffstats
path: root/Lib/test/crashers/weakref_in_del.py
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2007-01-23 22:41:20 (GMT)
committerBrett Cannon <bcannon@gmail.com>2007-01-23 22:41:20 (GMT)
commit75ba075110bbb3dcac6e975540bf8eda65774ec1 (patch)
tree012de9cedbf5036184d8bbbea0ec4da61ea1f00f /Lib/test/crashers/weakref_in_del.py
parent601d03a5be6a6952ecb57750f0365d6ef2abd4eb (diff)
downloadcpython-75ba075110bbb3dcac6e975540bf8eda65774ec1.zip
cpython-75ba075110bbb3dcac6e975540bf8eda65774ec1.tar.gz
cpython-75ba075110bbb3dcac6e975540bf8eda65774ec1.tar.bz2
If you created a weakref in an object's __del__ method to itself it would
segfault the interpreter during weakref clean up. Now any new weakrefs created after __del__ is run are removed silently. Fixes bug #1377858 and the weakref_in_del crasher for new-style classes. Classic classes are still affected.
Diffstat (limited to 'Lib/test/crashers/weakref_in_del.py')
-rw-r--r--Lib/test/crashers/weakref_in_del.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/crashers/weakref_in_del.py b/Lib/test/crashers/weakref_in_del.py
index 3bbcfc3..2e9b186 100644
--- a/Lib/test/crashers/weakref_in_del.py
+++ b/Lib/test/crashers/weakref_in_del.py
@@ -1,11 +1,12 @@
import weakref
# http://python.org/sf/1377858
+# Fixed for new-style classes in 2.5c1.
ref = None
def test_weakref_in_del():
- class Target(object):
+ class Target():
def __del__(self):
global ref
ref = weakref.ref(self)