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

This commit is contained in:
Victor Stinner 2015-03-30 21:38:00 +02:00
parent fa09beb150
commit 3c7d6e0693
6 changed files with 111 additions and 61 deletions

View file

@ -359,11 +359,10 @@ if hasattr(select, 'poll'):
# poll() has a resolution of 1 millisecond, round away from
# zero to wait *at least* timeout seconds.
timeout = math.ceil(timeout * 1e3)
fd_event_list = self._poll.poll(timeout)
ready = []
try:
fd_event_list = self._poll.poll(timeout)
except InterruptedError:
return ready
for fd, event in fd_event_list:
events = 0
if event & ~select.POLLIN: