summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2004-02-13 19:21:57 (GMT)
committerFred Drake <fdrake@acm.org>2004-02-13 19:21:57 (GMT)
commit55cf434735380ce51034c64722cf422457f891e0 (patch)
treeb6bf6dff9556eecede9542076f951f8c234e41ca /Lib/test
parent7a6d297bda367b7f373feed70bef6926cb675580 (diff)
downloadcpython-55cf434735380ce51034c64722cf422457f891e0.zip
cpython-55cf434735380ce51034c64722cf422457f891e0.tar.gz
cpython-55cf434735380ce51034c64722cf422457f891e0.tar.bz2
further testing indicates that the simplified version of the test
(re-using an existing test object class) no longer triggered the original segfault when the fix was backed out; restoring the local test object class to make the test effective the assignment of the ref created at the end does not affect the test, since the segfault happended before weakref.ref() returned; removing the assignment
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_weakref.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/Lib/test/test_weakref.py b/Lib/test/test_weakref.py
index 9ec607e..2924313 100644
--- a/Lib/test/test_weakref.py
+++ b/Lib/test/test_weakref.py
@@ -602,21 +602,23 @@ class ReferencesTestCase(TestBase):
thresholds = gc.get_threshold()
gc.set_threshold(1, 1, 1)
gc.collect()
+ class A:
+ pass
def callback(*args):
pass
- referenced = C()
+ referenced = A()
- a = C()
+ a = A()
a.a = a
a.wr = makeref(referenced)
try:
# now make sure the object and the ref get labeled as
# cyclic trash:
- a = C()
- a.wrc = weakref.ref(referenced, callback)
+ a = A()
+ weakref.ref(referenced, callback)
finally:
gc.set_threshold(*thresholds)