From: Fred Drake Date: Thu, 12 Feb 2004 19:30:17 +0000 (+0000) Subject: use existing test object instead of defining a new class X-Git-Tag: v2.4a1~827 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=61dafcb6caee4c0971e8aa362b1b170ce19199eb;p=python use existing test object instead of defining a new class --- diff --git a/Lib/test/test_weakref.py b/Lib/test/test_weakref.py index b2d266d9c3..9ec607eb89 100644 --- a/Lib/test/test_weakref.py +++ b/Lib/test/test_weakref.py @@ -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: