Skip to content

Commit c50cccf

Browse files
committed
test_eintr: Fix ResourceWarning warnings
1 parent e103aac commit c50cccf

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Lib/test/eintrdata/eintr_tester.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ def _test_wait_multiple(self, wait_func):
8383
processes = [self.new_sleep_process() for _ in range(num)]
8484
for _ in range(num):
8585
wait_func()
86+
# Call the Popen method to avoid a ResourceWarning
87+
for proc in processes:
88+
proc.wait()
8689

8790
def test_wait(self):
8891
self._test_wait_multiple(os.wait)
@@ -94,6 +97,8 @@ def test_wait3(self):
9497
def _test_wait_single(self, wait_func):
9598
proc = self.new_sleep_process()
9699
wait_func(proc.pid)
100+
# Call the Popen method to avoid a ResourceWarning
101+
proc.wait()
97102

98103
def test_waitpid(self):
99104
self._test_wait_single(lambda pid: os.waitpid(pid, 0))

0 commit comments

Comments
 (0)