THRIFT-3649 Python TSaslClientTransport initializes TTransportException incorrectly
Client: Python
Patch: Tristen Georgiou modified by Nobuaki Sukegawa
This closes #879
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 @@
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))