bpo-28254: Cleanup test_subprocess.test_preexec_gc_module_failure() (GH-25709)

Saving/restoring gc.disable and gc.isenabled is no longer needed.
This commit is contained in:
Victor Stinner 2021-04-29 10:26:53 +02:00 committed by GitHub
parent 5bd0619533
commit b1f413e6cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 4 deletions

View File

@ -2148,8 +2148,6 @@ class POSIXProcessTestCase(BaseTestCase):
# This tests the code that disables garbage collection if the child
# process will execute any Python.
enabled = gc.isenabled()
orig_gc_disable = gc.disable
orig_gc_isenabled = gc.isenabled
try:
gc.disable()
self.assertFalse(gc.isenabled())
@ -2164,8 +2162,6 @@ class POSIXProcessTestCase(BaseTestCase):
preexec_fn=lambda: None)
self.assertTrue(gc.isenabled(), "Popen left gc disabled.")
finally:
gc.disable = orig_gc_disable
gc.isenabled = orig_gc_isenabled
if not enabled:
gc.disable()