Commit 61dafcb6 authored by Fred Drake's avatar Fred Drake

use existing test object instead of defining a new class

parent ce3caf2e
......@@ -602,22 +602,20 @@ class ReferencesTestCase(TestBase):
thresholds = gc.get_threshold()
gc.set_threshold(1, 1, 1)
gc.collect()
class A:
pass
def callback(*args):
pass
referenced = A()
referenced = C()
a = A()
a = C()
a.a = a
a.wr = makeref(referenced)
try:
# now make sure the object and the ref get labeled as
# cyclic trash:
a = A()
a = C()
a.wrc = weakref.ref(referenced, callback)
finally:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment