mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #23485: select.devpoll.poll() is now retried when interrupted by a signal
This commit is contained in:
parent
4448c08451
commit
45ca48b03d
5 changed files with 85 additions and 49 deletions
|
@ -479,11 +479,10 @@ if hasattr(select, 'devpoll'):
|
|||
# devpoll() 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._devpoll.poll(timeout)
|
||||
|
||||
ready = []
|
||||
try:
|
||||
fd_event_list = self._devpoll.poll(timeout)
|
||||
except InterruptedError:
|
||||
return ready
|
||||
for fd, event in fd_event_list:
|
||||
events = 0
|
||||
if event & ~select.POLLIN:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue