equal
deleted
inserted
replaced
184 def waitforworkers(blocking=True): |
184 def waitforworkers(blocking=True): |
185 for pid in pids.copy(): |
185 for pid in pids.copy(): |
186 p = st = 0 |
186 p = st = 0 |
187 try: |
187 try: |
188 p, st = os.waitpid(pid, (0 if blocking else os.WNOHANG)) |
188 p, st = os.waitpid(pid, (0 if blocking else os.WNOHANG)) |
189 except OSError as e: |
189 except ChildProcessError: |
190 if e.errno == errno.ECHILD: |
190 # child would already be reaped, but pids yet been |
191 # child would already be reaped, but pids yet been |
191 # updated (maybe interrupted just after waitpid) |
192 # updated (maybe interrupted just after waitpid) |
192 pids.discard(pid) |
193 pids.discard(pid) |
|
194 else: |
|
195 raise |
|
196 if not p: |
193 if not p: |
197 # skip subsequent steps, because child process should |
194 # skip subsequent steps, because child process should |
198 # be still running in this case |
195 # be still running in this case |
199 continue |
196 continue |
200 pids.discard(p) |
197 pids.discard(p) |