mirror of
https://github.com/python/cpython.git
synced 2025-10-16 03:40:58 +00:00
Fix refleak in test_gc
This commit is contained in:
parent
71382cb64b
commit
6b64fc6bff
1 changed files with 2 additions and 1 deletions
|
@ -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):
|
||||||
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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue