@@ -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,
@@ -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)
@@ -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):
@@ -175,8 +175,8 @@
_metaitemtypes = {
- constants.METAKEYFLAG: (int, pycompat.long),
- constants.METAKEYSIZE: (int, pycompat.long),
+ constants.METAKEYFLAG: (int, int),
+ constants.METAKEYSIZE: (int, int),
}
@@ -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