spladug commented on a change in pull request #2200:
URL: https://github.com/apache/thrift/pull/2200#discussion_r464656554
##########
File path: lib/py/src/transport/TSocket.py
##########
@@ -91,12 +91,13 @@ def isOpen(self):
try:
peeked_bytes = self.handle.recv(1, socket.MSG_PEEK)
except (socket.error, OSError) as exc: # on modern python this is
just BlockingIOError
- if exc.errno == errno.EWOULDBLOCK:
+ if exc.errno in (errno.EWOULDBLOCK, errno.EAGAIN):
return True
- raise
+ return False
Review comment:
What kinds of errors are you concerned about? An over-broad catch like
that would mask if someone made a legitimate bug in the covered code. AFAIK
even in 2.7 `socket.error` should catch everything actually socket related:
https://docs.python.org/2/library/socket.html#socket.error
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]