diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2011-10-23 21:49:42 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-10-23 21:49:42 (GMT) |
commit | 24d659daafd0e6c1514ee912f06f7b7310545e09 (patch) | |
tree | dfde423cd56334b8e85e8778b491f928d6a2c20b /Lib/socket.py | |
parent | dcbb822c08e75dbb45afe1c435af95961f22387a (diff) | |
download | cpython-24d659daafd0e6c1514ee912f06f7b7310545e09.zip cpython-24d659daafd0e6c1514ee912f06f7b7310545e09.tar.gz cpython-24d659daafd0e6c1514ee912f06f7b7310545e09.tar.bz2 |
Use InterruptedError instead of checking for EINTR
Diffstat (limited to 'Lib/socket.py')
-rw-r--r-- | Lib/socket.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Lib/socket.py b/Lib/socket.py index 5715034..b2954b5 100644 --- a/Lib/socket.py +++ b/Lib/socket.py @@ -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 |