mirror of
https://github.com/python/cpython.git
synced 2025-10-08 08:01:55 +00:00
Use InterruptedError instead of checking for EINTR
This commit is contained in:
parent
dcbb822c08
commit
24d659daaf
6 changed files with 17 additions and 38 deletions
|
@ -53,7 +53,6 @@ try:
|
|||
except ImportError:
|
||||
errno = None
|
||||
EBADF = getattr(errno, 'EBADF', 9)
|
||||
EINTR = getattr(errno, 'EINTR', 4)
|
||||
EAGAIN = getattr(errno, 'EAGAIN', 11)
|
||||
EWOULDBLOCK = getattr(errno, 'EWOULDBLOCK', 11)
|
||||
|
||||
|
@ -280,11 +279,10 @@ class SocketIO(io.RawIOBase):
|
|||
except timeout:
|
||||
self._timeout_occurred = True
|
||||
raise
|
||||
except InterruptedError:
|
||||
continue
|
||||
except error as e:
|
||||
n = e.args[0]
|
||||
if n == EINTR:
|
||||
continue
|
||||
if n in _blocking_errnos:
|
||||
if e.args[0] in _blocking_errnos:
|
||||
return None
|
||||
raise
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue