mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
Issue #23485: select.poll.poll() is now retried when interrupted by a signal
This commit is contained in:
parent
fa09beb150
commit
3c7d6e0693
6 changed files with 111 additions and 61 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue