py3: use int instead of pycompat.long
authorGregory Szorc <gregory.szorc@gmail.com>
Tue, 01 Mar 2022 20:50:34 -0800
changeset 48932 176f1a0d15dc
parent 48931 6f10a2d6adf9
child 48933 78f1de3f4be7
py3: use int instead of pycompat.long pycompat.long is aliased to int. So this should have no change in functionality. Differential Revision: https://phab.mercurial-scm.org/D12338
hgext/convert/monotone.py
hgext/remotefilelog/shallowutil.py
mercurial/formatter.py
mercurial/templatefilters.py
mercurial/utils/cborutil.py
--- a/hgext/convert/monotone.py	Mon Feb 21 11:13:37 2022 -0700
+++ b/hgext/convert/monotone.py	Tue Mar 01 20:50:34 2022 -0800
@@ -150,7 +150,7 @@
                 raise error.Abort(_(b'bad mtn packet - no end of packet size'))
             lengthstr += read
         try:
-            length = pycompat.long(lengthstr[:-1])
+            length = int(lengthstr[:-1])
         except TypeError:
             raise error.Abort(
                 _(b'bad mtn packet - bad packet size %s') % lengthstr
--- a/hgext/remotefilelog/shallowutil.py	Mon Feb 21 11:13:37 2022 -0700
+++ b/hgext/remotefilelog/shallowutil.py	Tue Mar 01 20:50:34 2022 -0800
@@ -175,8 +175,8 @@
 
 
 _metaitemtypes = {
-    constants.METAKEYFLAG: (int, pycompat.long),
-    constants.METAKEYSIZE: (int, pycompat.long),
+    constants.METAKEYFLAG: (int, int),
+    constants.METAKEYSIZE: (int, int),
 }
 
 
--- a/mercurial/formatter.py	Mon Feb 21 11:13:37 2022 -0700
+++ b/mercurial/formatter.py	Tue Mar 01 20:50:34 2022 -0800
@@ -141,7 +141,7 @@
     Returns False if the object is unsupported or must be pre-processed by
     formatdate(), formatdict(), or formatlist().
     """
-    return isinstance(obj, (type(None), bool, int, pycompat.long, float, bytes))
+    return isinstance(obj, (type(None), bool, int, int, float, bytes))
 
 
 class _nullconverter(object):
--- a/mercurial/templatefilters.py	Mon Feb 21 11:13:37 2022 -0700
+++ b/mercurial/templatefilters.py	Tue Mar 01 20:50:34 2022 -0800
@@ -334,7 +334,7 @@
         return b'false'
     elif obj is True:
         return b'true'
-    elif isinstance(obj, (int, pycompat.long, float)):
+    elif isinstance(obj, (int, int, float)):
         return pycompat.bytestr(obj)
     elif isinstance(obj, bytes):
         return b'"%s"' % encoding.jsonescape(obj, paranoid=paranoid)
--- a/mercurial/utils/cborutil.py	Mon Feb 21 11:13:37 2022 -0700
+++ b/mercurial/utils/cborutil.py	Tue Mar 01 20:50:34 2022 -0800
@@ -9,7 +9,6 @@
 import struct
 import sys
 
-from .. import pycompat
 
 # Very short very of RFC 7049...
 #
@@ -207,7 +206,7 @@
 STREAM_ENCODERS = {
     bytes: streamencodebytestring,
     int: streamencodeint,
-    pycompat.long: streamencodeint,
+    int: streamencodeint,
     list: streamencodearray,
     tuple: streamencodearray,
     dict: streamencodemap,