comparison mercurial/commandserver.py @ 49311:dfdf85f37215

py3: catch ChildProcessError instead of checking errno == ECHILD
author Manuel Jacob <me@manueljacob.de>
date Tue, 31 May 2022 04:18:22 +0200
parents ee4537e365c8
children 48f1b314056b
comparison
equal deleted inserted replaced
49310:ee4537e365c8 49311:dfdf85f37215
691 691
692 def _reapworkers(self, options): 692 def _reapworkers(self, options):
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
702 if pid == 0: 700 if pid == 0:
703 # no waitable child processes 701 # no waitable child processes