From: Antoine Pitrou Date: Mon, 16 Apr 2012 19:29:02 +0000 (+0200) Subject: Fix refleak in test_gc X-Git-Tag: v3.3.0a3~194 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6b64fc6bffdb76b2fbe60b69df1845c13e0a0a23;p=thirdparty%2FPython%2Fcpython.git Fix refleak in test_gc --- diff --git a/Lib/test/test_gc.py b/Lib/test/test_gc.py index caf5a3d0f96b..90369752c9cf 100644 --- a/Lib/test/test_gc.py +++ b/Lib/test/test_gc.py @@ -551,6 +551,7 @@ class GCCallbackTests(unittest.TestCase): gc.set_debug(0) gc.callbacks.append(self.cb1) gc.callbacks.append(self.cb2) + self.othergarbage = [] def tearDown(self): # Restore gc state @@ -566,9 +567,9 @@ class GCCallbackTests(unittest.TestCase): if isinstance(obj, Uncollectable): obj.partner = None del gc.garbage[:] + del self.othergarbage gc.collect() - othergarbage = [] def preclean(self): # Remove all fluff from the system. Invoke this function # manually rather than through self.setUp() for maximum