# HG changeset patch # User Jun Wu # Date 2017-07-16 18:17:00 # Node ID 3ef3bf704e4709c2840b1ffb2f9d69a5341b00b4 # Parent b11e8c67fb0f9f692d680fbe0f3793e9bdeb29b7 commandserver: do not handle EINTR for selector.select selectors2 library handles EINTR transparently so we don't need to handle select.error ourselves. diff --git a/mercurial/commandserver.py b/mercurial/commandserver.py --- a/mercurial/commandserver.py +++ b/mercurial/commandserver.py @@ -11,7 +11,6 @@ import errno import gc import os import random -import select import signal import socket import struct @@ -488,15 +487,15 @@ class unixforkingservice(object): # waiting for recv() will receive ECONNRESET. self._unlinksocket() exiting = True + ready = selector.select(timeout=h.pollinterval) + if not ready: + # only exit if we completed all queued requests + if exiting: + break + continue try: - ready = selector.select(timeout=h.pollinterval) - if not ready: - # only exit if we completed all queued requests - if exiting: - break - continue conn, _addr = self._sock.accept() - except (select.error, socket.error) as inst: + except socket.error as inst: if inst.args[0] == errno.EINTR: continue raise