Remove unnecessary TException.message hack
Thrift attempts to work-around the Python 2.7 DeprecationWarning
around `BaseException.message` by using a property. This hack is
unnecessary since `message` is _also_ written as a regular attribute in
the `TException` constructor (and would be in any of its children),
hence the `BaseException_get_message()` wouldn't even be called.
This hack also stands in the way of making exception instances
immutable (which is a prerequisute to fixing THRIFT-4002).
diff --git a/lib/py/src/Thrift.py b/lib/py/src/Thrift.py
index c390cbb..b335bc1 100644
--- a/lib/py/src/Thrift.py
+++ b/lib/py/src/Thrift.py
@@ -90,15 +90,6 @@
class TException(Exception):
"""Base class for all thrift exceptions."""
- # BaseException.message is deprecated in Python v[2.6,3.0)
- if (2, 6, 0) <= sys.version_info < (3, 0):
- def _get_message(self):
- return self._message
-
- def _set_message(self, message):
- self._message = message
- message = property(_get_message, _set_message)
-
def __init__(self, message=None):
Exception.__init__(self, message)
self.message = message