##// 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 while self._workerpids:
693 while self._workerpids:
694 try:
694 try:
695 pid, _status = os.waitpid(-1, options)
695 pid, _status = os.waitpid(-1, options)
696 except OSError as inst:
696 except ChildProcessError:
697 if inst.errno != errno.ECHILD:
698 raise
699 # no child processes at all (reaped by other waitpid()?)
697 # no child processes at all (reaped by other waitpid()?)
700 self._workerpids.clear()
698 self._workerpids.clear()
701 return
699 return
@@ -186,13 +186,10 b' def _posixworker(ui, func, staticargs, a'
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:
191 # child would already be reaped, but pids yet been
190 # child would already be reaped, but pids yet been
192 # updated (maybe interrupted just after waitpid)
191 # updated (maybe interrupted just after waitpid)
193 pids.discard(pid)
192 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
General Comments 0
You need to be logged in to leave comments. Login now