From: Bryan Duxbury Date: Thu, 2 Sep 2010 00:36:18 +0000 (+0000) Subject: THRIFT-824. py: TApplicationException.__str__() refers to class constants as globals X-Git-Tag: 0.5.0~77 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=686d92ce66c100e8fc9671ea8a021aca21adc5cf;p=common%2Fthrift.git 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 5f2564de..91728a77 100644 --- a/lib/py/src/Thrift.py +++ b/lib/py/src/Thrift.py @@ -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'