diff options
Diffstat (limited to 'Lib/socket.py')
-rw-r--r-- | Lib/socket.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Lib/socket.py b/Lib/socket.py index 1e28549..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) @@ -112,6 +111,9 @@ class socket(_socket.socket): s[7:]) return s + def __getstate__(self): + raise TypeError("Cannot serialize socket object") + def dup(self): """dup() -> socket object @@ -277,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 |