Repository: thrift
Updated Branches:
  refs/heads/master 33de26cf6 -> 3b4a93bba


THRIFT-3649 Python TSaslClientTransport initializes TTransportException 
incorrectly
Client: Python
Patch: Tristen Georgiou modified by Nobuaki Sukegawa

This closes #879


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/a72ffbea
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/a72ffbea
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/a72ffbea

Branch: refs/heads/master
Commit: a72ffbea4d05586d39b507e5cd6451086fc4f763
Parents: 33de26c
Author: Tristen Georgiou <tristen.georg...@gmail.com>
Authored: Sat Feb 20 07:28:47 2016 +0900
Committer: Nobuaki Sukegawa <ns...@apache.org>
Committed: Mon Feb 22 23:24:31 2016 +0900

----------------------------------------------------------------------
 lib/py/src/transport/TTransport.py | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/a72ffbea/lib/py/src/transport/TTransport.py
----------------------------------------------------------------------
diff --git a/lib/py/src/transport/TTransport.py 
b/lib/py/src/transport/TTransport.py
index 6669891..5283fce 100644
--- a/lib/py/src/transport/TTransport.py
+++ b/lib/py/src/transport/TTransport.py
@@ -382,13 +382,17 @@ class TSaslClientTransport(TTransportBase, 
CReadableTransport):
                 self.send_sasl_msg(self.OK, self.sasl.process(challenge))
             elif status == self.COMPLETE:
                 if not self.sasl.complete:
-                    raise TTransportException("The server erroneously 
indicated "
-                                              "that SASL negotiation was 
complete")
+                    raise TTransportException(
+                        TTransportException.NOT_OPEN,
+                        "The server erroneously indicated "
+                        "that SASL negotiation was complete")
                 else:
                     break
             else:
-                raise TTransportException("Bad SASL negotiation status: %d 
(%s)"
-                                          % (status, challenge))
+                raise TTransportException(
+                    TTransportException.NOT_OPEN,
+                    "Bad SASL negotiation status: %d (%s)"
+                    % (status, challenge))
 
     def send_sasl_msg(self, status, body):
         header = pack(">BI", status, len(body))

Reply via email to