Fix refleak in test_gc
authorAntoine Pitrou <solipsis@pitrou.net>
Mon, 16 Apr 2012 19:29:02 +0000 (21:29 +0200)
committerAntoine Pitrou <solipsis@pitrou.net>
Mon, 16 Apr 2012 19:29:02 +0000 (21:29 +0200)
Lib/test/test_gc.py

index caf5a3d0f96bef18f8bcd231cffab48501fe0483..90369752c9cf96277ba9fa899a6f4f5f99f9969e 100644 (file)
@@ -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