Commit 6b64fc6b authored by Antoine Pitrou's avatar Antoine Pitrou

Fix refleak in test_gc

parent 71382cb6
...@@ -551,6 +551,7 @@ class GCCallbackTests(unittest.TestCase): ...@@ -551,6 +551,7 @@ class GCCallbackTests(unittest.TestCase):
gc.set_debug(0) gc.set_debug(0)
gc.callbacks.append(self.cb1) gc.callbacks.append(self.cb1)
gc.callbacks.append(self.cb2) gc.callbacks.append(self.cb2)
self.othergarbage = []
def tearDown(self): def tearDown(self):
# Restore gc state # Restore gc state
...@@ -566,9 +567,9 @@ class GCCallbackTests(unittest.TestCase): ...@@ -566,9 +567,9 @@ class GCCallbackTests(unittest.TestCase):
if isinstance(obj, Uncollectable): if isinstance(obj, Uncollectable):
obj.partner = None obj.partner = None
del gc.garbage[:] del gc.garbage[:]
del self.othergarbage
gc.collect() gc.collect()
othergarbage = []
def preclean(self): def preclean(self):
# Remove all fluff from the system. Invoke this function # Remove all fluff from the system. Invoke this function
# manually rather than through self.setUp() for maximum # manually rather than through self.setUp() for maximum
......
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