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

login
register
mail settings
Submitter Pulkit Goyal
Date March 7, 2017, 7:21 p.m.
Message ID <6ff8f348d278599b1dd7.1488914484@pulkit-goyal>
Download mbox | patch
Permalink /patch/18969/
State Accepted
Headers show

Comments

Pulkit Goyal - March 7, 2017, 7:21 p.m.
# HG changeset patch
# User Pulkit Goyal <7895pulkit@gmail.com>
# Date 1488914119 -19800
#      Wed Mar 08 00:45:19 2017 +0530
# Node ID 6ff8f348d278599b1dd79aa6b4d7c7c231ca7b58
# Parent  f8ec9104d219a01357e8f6118286d9b212695bbe
parsers: alias long to int on Python 3
Augie Fackler - March 8, 2017, 3:49 p.m.
On Wed, Mar 08, 2017 at 12:51:24AM +0530, Pulkit Goyal wrote:
> # HG changeset patch
> # User Pulkit Goyal <7895pulkit@gmail.com>
> # Date 1488914119 -19800
> #      Wed Mar 08 00:45:19 2017 +0530
> # Node ID 6ff8f348d278599b1dd79aa6b4d7c7c231ca7b58
> # Parent  f8ec9104d219a01357e8f6118286d9b212695bbe
> parsers: alias long to int on Python 3
>
> diff -r f8ec9104d219 -r 6ff8f348d278 mercurial/pure/parsers.py
> --- a/mercurial/pure/parsers.py	Wed Mar 08 00:40:15 2017 +0530
> +++ b/mercurial/pure/parsers.py	Wed Mar 08 00:45:19 2017 +0530
> @@ -14,6 +14,9 @@
>  from . import pycompat
>  stringio = pycompat.stringio
>
> +if pycompat.ispy3:
> +    long = int

Series is queued, but couldn't we just use int everywhere even in 2.6?
I thought int/long unification was already done enough by then...

> +
>  _pack = struct.pack
>  _unpack = struct.unpack
>  _compress = zlib.compress
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Patch

diff -r f8ec9104d219 -r 6ff8f348d278 mercurial/pure/parsers.py
--- a/mercurial/pure/parsers.py	Wed Mar 08 00:40:15 2017 +0530
+++ b/mercurial/pure/parsers.py	Wed Mar 08 00:45:19 2017 +0530
@@ -14,6 +14,9 @@ 
 from . import pycompat
 stringio = pycompat.stringio
 
+if pycompat.ispy3:
+    long = int
+
 _pack = struct.pack
 _unpack = struct.unpack
 _compress = zlib.compress