mirror of
https://github.com/AdaCore/cpython.git
synced 2026-02-12 12:57:15 -08:00
Issue #12352: In test_free_from_gc(), restore the GC thresholds even if the GC
wasn't enabled at first.
This commit is contained in:
@@ -1640,12 +1640,11 @@ class _TestHeap(BaseTestCase):
|
||||
# Make sure the GC is enabled, and set lower collection thresholds to
|
||||
# make collections more frequent (and increase the probability of
|
||||
# deadlock).
|
||||
if gc.isenabled():
|
||||
thresholds = gc.get_threshold()
|
||||
self.addCleanup(gc.set_threshold, *thresholds)
|
||||
else:
|
||||
if not gc.isenabled():
|
||||
gc.enable()
|
||||
self.addCleanup(gc.disable)
|
||||
thresholds = gc.get_threshold()
|
||||
self.addCleanup(gc.set_threshold, *thresholds)
|
||||
gc.set_threshold(10)
|
||||
|
||||
# perform numerous block allocations, with cyclic references to make
|
||||
|
||||
Reference in New Issue
Block a user