##// END OF EJS Templates
py3: catch ChildProcessError instead of checking errno == ECHILD
Manuel Jacob -
r50198:dfdf85f3 default
parent child Browse files
Show More
@@ -693,9 +693,7 b' class unixforkingservice:'
693 693 while self._workerpids:
694 694 try:
695 695 pid, _status = os.waitpid(-1, options)
696 except OSError as inst:
697 if inst.errno != errno.ECHILD:
698 raise
696 except ChildProcessError:
699 697 # no child processes at all (reaped by other waitpid()?)
700 698 self._workerpids.clear()
701 699 return
@@ -186,13 +186,10 b' def _posixworker(ui, func, staticargs, a'
186 186 p = st = 0
187 187 try:
188 188 p, st = os.waitpid(pid, (0 if blocking else os.WNOHANG))
189 except OSError as e:
190 if e.errno == errno.ECHILD:
189 except ChildProcessError:
191 190 # child would already be reaped, but pids yet been
192 191 # updated (maybe interrupted just after waitpid)
193 192 pids.discard(pid)
194 else:
195 raise
196 193 if not p:
197 194 # skip subsequent steps, because child process should
198 195 # be still running in this case
General Comments 0
You need to be logged in to leave comments. Login now