mirror of
https://github.com/python/cpython.git
synced 2026-01-06 07:22:09 +00:00
test_eintr: Fix ResourceWarning warnings
This commit is contained in:
parent
e103aaca67
commit
c50cccfcc3
1 changed files with 5 additions and 0 deletions
|
|
@ -83,6 +83,9 @@ def _test_wait_multiple(self, wait_func):
|
|||
processes = [self.new_sleep_process() for _ in range(num)]
|
||||
for _ in range(num):
|
||||
wait_func()
|
||||
# Call the Popen method to avoid a ResourceWarning
|
||||
for proc in processes:
|
||||
proc.wait()
|
||||
|
||||
def test_wait(self):
|
||||
self._test_wait_multiple(os.wait)
|
||||
|
|
@ -94,6 +97,8 @@ def test_wait3(self):
|
|||
def _test_wait_single(self, wait_func):
|
||||
proc = self.new_sleep_process()
|
||||
wait_func(proc.pid)
|
||||
# Call the Popen method to avoid a ResourceWarning
|
||||
proc.wait()
|
||||
|
||||
def test_waitpid(self):
|
||||
self._test_wait_single(lambda pid: os.waitpid(pid, 0))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue