File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -101,7 +101,11 @@ def _test_wait_multiple(self, wait_func):
101101 wait_func ()
102102 # Call the Popen method to avoid a ResourceWarning
103103 for proc in processes :
104- proc .wait ()
104+ try :
105+ proc .wait ()
106+ except ProcessLookupError :
107+ # Process already exited, which is expected but not always raised
108+ pass
105109
106110 def test_wait (self ):
107111 self ._test_wait_multiple (os .wait )
@@ -114,7 +118,11 @@ def _test_wait_single(self, wait_func):
114118 proc = self .new_sleep_process ()
115119 wait_func (proc .pid )
116120 # Call the Popen method to avoid a ResourceWarning
117- proc .wait ()
121+ try :
122+ proc .wait ()
123+ except ProcessLookupError :
124+ # Process already exited, which is expected but not always raised
125+ pass
118126
119127 def test_waitpid (self ):
120128 self ._test_wait_single (lambda pid : os .waitpid (pid , 0 ))
You can’t perform that action at this time.
0 commit comments