From fe94dc5f6b92c572b24a6356452a66451c27c968 Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Fri, 26 Jan 2024 13:04:51 +0100 Subject: [PATCH] Remove Python 3.1 compatibility from socket client (#802) --- pychromecast/socket_client.py | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/pychromecast/socket_client.py b/pychromecast/socket_client.py index 402d05a07..a4ec9ef2b 100644 --- a/pychromecast/socket_client.py +++ b/pychromecast/socket_client.py @@ -119,15 +119,6 @@ def _json_to_payload(data): return json.dumps(data, ensure_ascii=False) -def _is_ssl_timeout(exc): - """Returns True if the exception is for an SSL timeout""" - return exc.message in ( - "The handshake operation timed out", - "The write operation timed out", - "The read operation timed out", - ) - - @dataclass(frozen=True) class NetworkAddress: """Network address container.""" @@ -841,18 +832,6 @@ def _read_bytes_from_socket(self, msglen): self.port, ) continue - except ssl.SSLError as exc: - # Support older ssl implementations which does not raise - # socket.timeout on timeouts - if _is_ssl_timeout(exc): - self.logger.debug( - "[%s(%s):%s] ssl timeout in : _read_bytes_from_socket", - self.fn or "", - self.host, - self.port, - ) - continue - raise return b"".join(chunks) def _read_message(self):