Patchwork [2,of,7] py3: alias long to int on Python 3

login
register
mail settings
Submitter Pulkit Goyal
Date May 3, 2017, 9:59 a.m.
Message ID <af5154fdc7d485b090ba.1493805561@pulkit-goyal>
Download mbox | patch
Permalink /patch/20397/
State Accepted
Headers show

Comments

Pulkit Goyal - May 3, 2017, 9:59 a.m.
# HG changeset patch
# User Pulkit Goyal <7895pulkit@gmail.com>
# Date 1492698097 -19800
#      Thu Apr 20 19:51:37 2017 +0530
# Node ID af5154fdc7d485b090ba1bed3bb42addb7836469
# Parent  2069dd90c6afe4e13ab73cbbf572fd4b50680def
py3: alias long to int on Python 3
Yuya Nishihara - May 4, 2017, 2:06 a.m.
On Wed, 03 May 2017 15:29:21 +0530, Pulkit Goyal wrote:
> # HG changeset patch
> # User Pulkit Goyal <7895pulkit@gmail.com>
> # Date 1492698097 -19800
> #      Thu Apr 20 19:51:37 2017 +0530
> # Node ID af5154fdc7d485b090ba1bed3bb42addb7836469
> # Parent  2069dd90c6afe4e13ab73cbbf572fd4b50680def
> py3: alias long to int on Python 3

Queued 2, part of 3, 4, 5, and 7, thanks.

> --- a/mercurial/templatefilters.py	Sat Apr 08 11:02:37 2017 +0530
> +++ b/mercurial/templatefilters.py	Thu Apr 20 19:51:37 2017 +0530
> @@ -16,6 +16,7 @@
>      encoding,
>      hbisect,
>      node,
> +    pycompat,
>      registrar,
>      templatekw,
>      util,
> @@ -24,6 +25,9 @@
>  urlerr = util.urlerr
>  urlreq = util.urlreq
>  
> +if pycompat.ispy3:
> +    long = int

I prefer defining pycompat.long or something (like 'unicode'), but given
'long' isn't widely used, this should be okay.

Patch

diff -r 2069dd90c6af -r af5154fdc7d4 mercurial/templatefilters.py
--- a/mercurial/templatefilters.py	Sat Apr 08 11:02:37 2017 +0530
+++ b/mercurial/templatefilters.py	Thu Apr 20 19:51:37 2017 +0530
@@ -16,6 +16,7 @@ 
     encoding,
     hbisect,
     node,
+    pycompat,
     registrar,
     templatekw,
     util,
@@ -24,6 +25,9 @@ 
 urlerr = util.urlerr
 urlreq = util.urlreq
 
+if pycompat.ispy3:
+    long = int
+
 # filters are callables like:
 #   fn(obj)
 # with: