error.LookupError: rename 'message' property to something else
authorSiddharth Agarwal <sid0@fb.com>
Wed, 18 Feb 2015 16:45:16 -0800
changeset 24137 dcfdfd63bde4
parent 24136 46d6cdfce4bf
child 24138 eabe44ec5af5
error.LookupError: rename 'message' property to something else At least some installs of Python 2.6+ complain with: mercurial/error.py:26: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6 This patch renames the property away from 'message' so that Python no longer complains.
mercurial/error.py
--- a/mercurial/error.py	Thu Feb 19 19:32:06 2015 +0800
+++ b/mercurial/error.py	Wed Feb 18 16:45:16 2015 -0800
@@ -23,7 +23,9 @@
     def __init__(self, name, index, message):
         self.name = name
         self.index = index
-        self.message = message
+        # this can't be called 'message' because at least some installs of
+        # Python 2.6+ complain about the 'message' property being deprecated
+        self.lookupmessage = message
         if isinstance(name, str) and len(name) == 20:
             from node import short
             name = short(name)