diff options
author | Charles-François Natali <neologix@free.fr> | 2011-07-02 14:08:27 +0200 |
---|---|---|
committer | Charles-François Natali <neologix@free.fr> | 2011-07-02 14:08:27 +0200 |
commit | 7c20ad32fd79dfd5383b3cd75f433cdf0bacbd52 (patch) | |
tree | 9c994c18b5c07cb4ee40dfd4f738950e5443afdf /Lib/test/test_multiprocessing.py | |
parent | 414d0faedced1b7cb3585e76e0bdfff1795e15f3 (diff) | |
download | cpython-git-7c20ad32fd79dfd5383b3cd75f433cdf0bacbd52.tar.gz |
Issue #12352: In test_free_from_gc(), restore the GC thresholds even if the GC
wasn't enabled at first.
Diffstat (limited to 'Lib/test/test_multiprocessing.py')
-rw-r--r-- | Lib/test/test_multiprocessing.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/test/test_multiprocessing.py b/Lib/test/test_multiprocessing.py index 18a2f29f0a..6da4b17772 100644 --- 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(): - 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 |