cpython: 874143242d79 (original) (raw)
Mercurial > cpython
changeset 71125:874143242d79 2.7
Issue #12352: In test_free_from_gc(), restore the GC thresholds even if the GC wasn't enabled at first. [#12352]
Charles-François Natali neologix@free.fr | |
---|---|
date | Sat, 02 Jul 2011 14:08:27 +0200 |
parents | 96a0788583c6 |
children | 08400969067e |
files | Lib/test/test_multiprocessing.py |
diffstat | 1 files changed, 3 insertions(+), 4 deletions(-)[+] [-] Lib/test/test_multiprocessing.py 7 |
line wrap: on
line diff
--- a/Lib/test/test_multiprocessing.py +++ b/Lib/test/test_multiprocessing.py @@ -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():[](#l1.7)
thresholds = gc.get_threshold()[](#l1.8)
self.addCleanup(gc.set_threshold, *thresholds)[](#l1.9)
else:[](#l1.10)
if not gc.isenabled():[](#l1.11) gc.enable()[](#l1.12) self.addCleanup(gc.disable)[](#l1.13)
thresholds = gc.get_threshold()[](#l1.14)
self.addCleanup(gc.set_threshold, *thresholds)[](#l1.15) gc.set_threshold(10)[](#l1.16)
# perform numerous block allocations, with cyclic references to make