Mercurial > public > mercurial-scm > hg-stable
diff mercurial/commandserver.py @ 49310:ee4537e365c8
py3: remove retry on EINTR errno
Since the implementation of PEP 475 (Python 3.5), Python retries system calls
failing with EINTR. Therefore we don?t need the logic that retries it in Python
code.
author | Manuel Jacob <me@manueljacob.de> |
---|---|
date | Tue, 31 May 2022 04:11:34 +0200 |
parents | 311fcc5a65f6 |
children | dfdf85f37215 |
line wrap: on
line diff
--- a/mercurial/commandserver.py Tue May 31 03:39:42 2022 +0200 +++ b/mercurial/commandserver.py Tue May 31 04:11:34 2022 +0200 @@ -650,12 +650,7 @@ def _acceptnewconnection(self, sock, selector): h = self._servicehandler - try: - conn, _addr = sock.accept() - except socket.error as inst: - if inst.args[0] == errno.EINTR: - return - raise + conn, _addr = sock.accept() # Future improvement: On Python 3.7, maybe gc.freeze() can be used # to prevent COW memory from being touched by GC. @@ -688,12 +683,7 @@ def _handlemainipc(self, sock, selector): """Process messages sent from a worker""" - try: - path = sock.recv(32768) # large enough to receive path - except socket.error as inst: - if inst.args[0] == errno.EINTR: - return - raise + path = sock.recv(32768) # large enough to receive path self._repoloader.load(path) def _sigchldhandler(self, signal, frame): @@ -704,8 +694,6 @@ try: pid, _status = os.waitpid(-1, options) except OSError as inst: - if inst.errno == errno.EINTR: - continue if inst.errno != errno.ECHILD: raise # no child processes at all (reaped by other waitpid()?)