summaryrefslogtreecommitdiffstats
path: root/Lib/ConfigParser.py
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2007-05-05 01:34:02 (GMT)
committerBrett Cannon <bcannon@gmail.com>2007-05-05 01:34:02 (GMT)
commit229cee2d3dc2d962d5cbda96f2411c5cec0a9293 (patch)
tree3a474da4aafdfa18c6b6f8848c4792e70e5b9ad0 /Lib/ConfigParser.py
parent2ebc4d8054615e9e5ad8ef6e35aad6ac419233c8 (diff)
downloadcpython-229cee2d3dc2d962d5cbda96f2411c5cec0a9293.zip
cpython-229cee2d3dc2d962d5cbda96f2411c5cec0a9293.tar.gz
cpython-229cee2d3dc2d962d5cbda96f2411c5cec0a9293.tar.bz2
Deprecate BaseException.message as per PEP 352.
Diffstat (limited to 'Lib/ConfigParser.py')
-rw-r--r--Lib/ConfigParser.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/ConfigParser.py b/Lib/ConfigParser.py
index 2902939..131d697 100644
--- a/Lib/ConfigParser.py
+++ b/Lib/ConfigParser.py
@@ -106,6 +106,21 @@ MAX_INTERPOLATION_DEPTH = 10
class Error(Exception):
"""Base class for ConfigParser exceptions."""
+ def _get_message(self):
+ """Getter for 'message'; needed only to override deprecation in
+ BaseException."""
+ return self.__message
+
+ def _set_message(self, value):
+ """Setter for 'message'; needed only to override deprecation in
+ BaseException."""
+ self.__message = value
+
+ # BaseException.message has been deprecated since Python 2.6. To prevent
+ # DeprecationWarning from popping up over this pre-existing attribute, use
+ # a new property that takes lookup precedence.
+ message = property(_get_message, _set_message)
+
def __init__(self, msg=''):
self.message = msg
Exception.__init__(self, msg)