Author: bryanduxbury
Date: Thu Sep 2 00:36:18 2010
New Revision: 991781
URL: http://svn.apache.org/viewvc?rev=991781&view=rev
Log:
THRIFT-824. py: TApplicationException.__str__() refers to class constants as
globals
Refer to constants via 'self'.
Patch: Peter Schuller
Modified:
incubator/thrift/trunk/lib/py/src/Thrift.py
Modified: incubator/thrift/trunk/lib/py/src/Thrift.py
URL:
http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/py/src/Thrift.py?rev=991781&r1=991780&r2=991781&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/py/src/Thrift.py (original)
+++ incubator/thrift/trunk/lib/py/src/Thrift.py Thu Sep 2 00:36:18 2010
@@ -85,15 +85,15 @@ class TApplicationException(TException):
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'