Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/py/src/transport/TSocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ def open(self):
def read(self, sz):
try:
buff = self.handle.recv(sz)
except socket.timeout as e:
# TODO: remove socket.timeout when 3.10 becomes the earliest version of python supported.
except (socket.timeout, TimeoutError) as e:
raise TTransportException(type=TTransportException.TIMED_OUT, message="read timeout", inner=e)
except socket.error as e:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similarly socket.error is also going to be a deprecated alias to OSError so we probably want to do something similar here.

if (e.args[0] == errno.ECONNRESET and
Expand Down