[PATCH] py3: leverage pycompat.long
Pierre-Yves David
pierre-yves.david at ens-lyon.org
Mon Oct 28 11:02:07 UTC 2019
This patch looks goods
On 10/27/19 5:15 AM, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya at tcha.org>
> # Date 1572148313 -32400
> # Sun Oct 27 12:51:53 2019 +0900
> # Node ID 77e348a48bac41c28887c2b10afac4a2f6b4bc69
> # Parent fb5c72501de2451a9c785da2912267565ad53cc6
> py3: leverage pycompat.long
>
> diff --git a/mercurial/templatefilters.py b/mercurial/templatefilters.py
> --- a/mercurial/templatefilters.py
> +++ b/mercurial/templatefilters.py
> @@ -31,9 +31,6 @@ from .utils import (
> urlerr = util.urlerr
> urlreq = util.urlreq
>
> -if pycompat.ispy3:
> - long = int
> -
> # filters are callables like:
> # fn(obj)
> # with:
> @@ -329,7 +326,7 @@ def json(obj, paranoid=True):
> return b'false'
> elif obj is True:
> return b'true'
> - elif isinstance(obj, (int, long, float)):
> + elif isinstance(obj, (int, pycompat.long, float)):
> return pycompat.bytestr(obj)
> elif isinstance(obj, bytes):
> return b'"%s"' % encoding.jsonescape(obj, paranoid=paranoid)
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
--
Pierre-Yves David
More information about the Mercurial-devel
mailing list