THRIFT-824. py: TApplicationException.__str__() refers to class constants as globals
Refer to constants via 'self'.
Patch: Peter Schuller
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991781 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/py/src/Thrift.py b/lib/py/src/Thrift.py
index 5f2564d..91728a7 100644
--- a/lib/py/src/Thrift.py
+++ b/lib/py/src/Thrift.py
@@ -85,15 +85,15 @@
def __str__(self):
if self.message:
return self.message
- elif self.type == UNKNOWN_METHOD:
+ elif self.type == self.UNKNOWN_METHOD:
return 'Unknown method'
- elif self.type == INVALID_MESSAGE_TYPE:
+ elif self.type == self.INVALID_MESSAGE_TYPE:
return 'Invalid message type'
- elif self.type == WRONG_METHOD_NAME:
+ elif self.type == self.WRONG_METHOD_NAME:
return 'Wrong method name'
- elif self.type == BAD_SEQUENCE_ID:
+ elif self.type == self.BAD_SEQUENCE_ID:
return 'Bad sequence ID'
- elif self.type == MISSING_RESULT:
+ elif self.type == self.MISSING_RESULT:
return 'Missing result'
else:
return 'Default (unknown) TApplicationException'