fishy commented on code in PR #2620:
URL: https://github.com/apache/thrift/pull/2620#discussion_r893004731


##########
lib/py/test/test_socket.py:
##########
@@ -25,6 +25,7 @@ def test_isOpen_checks_for_readability(self):
             acc.start()
 
             sock = TSocket(host="localhost", port=acc.port)
+            self.assertFalse(sock.IsOpen())

Review Comment:
   this is a typo. it should be `isOpen` instead of `IsOpen`. it's currently 
causing CI failures: 
https://app.travis-ci.com/github/apache/thrift/jobs/572946806 & 
https://app.travis-ci.com/github/apache/thrift/jobs/572946807



##########
lib/py/src/transport/TSSLSocket.py:
##########
@@ -266,6 +266,10 @@ def __init__(self, host='localhost', port=9090, *args, 
**kwargs):
         TSocket.TSocket.__init__(self, host, port, unix_socket,
                                  socket_keepalive=socket_keepalive)
 
+    # Override TSocket because ssl.SSLSocket does not allow non-zero flags in 
calls to recv()
+    def isOpen(self):
+        return self.handle is not None

Review Comment:
   I would slightly prefer to just catch the exception in `TSocket.isOpen`, but 
I don't feel strongly either way.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to