Skip to content

Commit

Permalink
Remove Python 3.1 compatibility from socket client (#802)
Browse files Browse the repository at this point in the history
  • Loading branch information
emontnemery authored Jan 26, 2024
1 parent ebf9b7b commit fe94dc5
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions pychromecast/socket_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit fe94dc5

Please sign in to comment.