mirror of https://github.com/python/cpython
Merge: Fix ResourceWarnings in test_subprocess.
This commit is contained in:
commit
74adbaa7bd
|
@ -1501,6 +1501,8 @@ class POSIXProcessTestCase(BaseTestCase):
|
||||||
'time.sleep(0.2)'],
|
'time.sleep(0.2)'],
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.PIPE)
|
stderr=subprocess.PIPE)
|
||||||
|
self.addCleanup(p.stdout.close)
|
||||||
|
self.addCleanup(p.stderr.close)
|
||||||
ident = id(p)
|
ident = id(p)
|
||||||
pid = p.pid
|
pid = p.pid
|
||||||
del p
|
del p
|
||||||
|
@ -1518,6 +1520,8 @@ class POSIXProcessTestCase(BaseTestCase):
|
||||||
'time.sleep(3)'],
|
'time.sleep(3)'],
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.PIPE)
|
stderr=subprocess.PIPE)
|
||||||
|
self.addCleanup(p.stdout.close)
|
||||||
|
self.addCleanup(p.stderr.close)
|
||||||
ident = id(p)
|
ident = id(p)
|
||||||
pid = p.pid
|
pid = p.pid
|
||||||
del p
|
del p
|
||||||
|
|
Loading…
Reference in New Issue