Issue #23485: select.kqueue.control() is now retried when interrupted by a signal

This commit is contained in:
Victor Stinner 2015-03-31 11:48:34 +02:00
parent b6faf0dfa7
commit 4448c08451
5 changed files with 58 additions and 19 deletions

View file

@ -549,11 +549,9 @@ if hasattr(select, 'kqueue'):
def select(self, timeout=None):
timeout = None if timeout is None else max(timeout, 0)
max_ev = len(self._fd_to_key)
kev_list = self._kqueue.control(None, max_ev, timeout)
ready = []
try:
kev_list = self._kqueue.control(None, max_ev, timeout)
except InterruptedError:
return ready
for kev in kev_list:
fd = kev.ident
flag = kev.filter