mirror of
https://github.com/python/cpython.git
synced 2025-10-07 07:31:46 +00:00
Issue #23485: select.kqueue.control() is now retried when interrupted by a signal
This commit is contained in:
parent
b6faf0dfa7
commit
4448c08451
5 changed files with 58 additions and 19 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue