mirror of https://github.com/python/cpython
Fix resource leaks in test_subprocess.
This commit is contained in:
parent
a8085d306e
commit
860593653b
|
@ -955,6 +955,8 @@ class POSIXProcessTestCase(BaseTestCase):
|
|||
'time.sleep(0.2)'],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
self.addCleanup(p.stdout.close)
|
||||
self.addCleanup(p.stderr.close)
|
||||
ident = id(p)
|
||||
pid = p.pid
|
||||
del p
|
||||
|
@ -972,6 +974,8 @@ class POSIXProcessTestCase(BaseTestCase):
|
|||
'time.sleep(3)'],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
self.addCleanup(p.stdout.close)
|
||||
self.addCleanup(p.stderr.close)
|
||||
ident = id(p)
|
||||
pid = p.pid
|
||||
del p
|
||||
|
|
Loading…
Reference in New Issue