Patchwork error.LookupError: rename 'message' property to something else

login
register
mail settings
Submitter Siddharth Agarwal
Date Feb. 19, 2015, 12:48 a.m.
Message ID <5ec1d18f8d72d4a17f8d.1424306938@devbig136.prn2.facebook.com>
Download mbox | patch
Permalink /patch/7811/
State Accepted
Headers show

Comments

Siddharth Agarwal - Feb. 19, 2015, 12:48 a.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1424306716 28800
#      Wed Feb 18 16:45:16 2015 -0800
# Node ID 5ec1d18f8d72d4a17f8d4af7e4af8bab9472c7c0
# Parent  ff5caa8dfd993680d9602ca6ebb14da9de10d5f4
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.
Augie Fackler - Feb. 19, 2015, 9:03 p.m.
On Wed, Feb 18, 2015 at 04:48:58PM -0800, Siddharth Agarwal wrote:
> # HG changeset patch
> # User Siddharth Agarwal <sid0@fb.com>
> # Date 1424306716 28800
> #      Wed Feb 18 16:45:16 2015 -0800
> # Node ID 5ec1d18f8d72d4a17f8d4af7e4af8bab9472c7c0
> # Parent  ff5caa8dfd993680d9602ca6ebb14da9de10d5f4
> error.LookupError: rename 'message' property to something else

Queued, thanks.

>
> 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.
>
> diff --git a/mercurial/error.py b/mercurial/error.py
> --- a/mercurial/error.py
> +++ b/mercurial/error.py
> @@ -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)
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/mercurial/error.py b/mercurial/error.py
--- a/mercurial/error.py
+++ b/mercurial/error.py
@@ -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)