##// END OF EJS Templates
py3: use int instead of pycompat.long...
Gregory Szorc -
r49787:176f1a0d default
parent child Browse files
Show More
@@ -150,7 +150,7 b' class monotone_source(common.converter_s'
150 raise error.Abort(_(b'bad mtn packet - no end of packet size'))
150 raise error.Abort(_(b'bad mtn packet - no end of packet size'))
151 lengthstr += read
151 lengthstr += read
152 try:
152 try:
153 length = pycompat.long(lengthstr[:-1])
153 length = int(lengthstr[:-1])
154 except TypeError:
154 except TypeError:
155 raise error.Abort(
155 raise error.Abort(
156 _(b'bad mtn packet - bad packet size %s') % lengthstr
156 _(b'bad mtn packet - bad packet size %s') % lengthstr
@@ -175,8 +175,8 b' def _buildpackmeta(metadict):'
175
175
176
176
177 _metaitemtypes = {
177 _metaitemtypes = {
178 constants.METAKEYFLAG: (int, pycompat.long),
178 constants.METAKEYFLAG: (int, int),
179 constants.METAKEYSIZE: (int, pycompat.long),
179 constants.METAKEYSIZE: (int, int),
180 }
180 }
181
181
182
182
@@ -141,7 +141,7 b' def isprintable(obj):'
141 Returns False if the object is unsupported or must be pre-processed by
141 Returns False if the object is unsupported or must be pre-processed by
142 formatdate(), formatdict(), or formatlist().
142 formatdate(), formatdict(), or formatlist().
143 """
143 """
144 return isinstance(obj, (type(None), bool, int, pycompat.long, float, bytes))
144 return isinstance(obj, (type(None), bool, int, int, float, bytes))
145
145
146
146
147 class _nullconverter(object):
147 class _nullconverter(object):
@@ -334,7 +334,7 b' def json(obj, paranoid=True):'
334 return b'false'
334 return b'false'
335 elif obj is True:
335 elif obj is True:
336 return b'true'
336 return b'true'
337 elif isinstance(obj, (int, pycompat.long, float)):
337 elif isinstance(obj, (int, int, float)):
338 return pycompat.bytestr(obj)
338 return pycompat.bytestr(obj)
339 elif isinstance(obj, bytes):
339 elif isinstance(obj, bytes):
340 return b'"%s"' % encoding.jsonescape(obj, paranoid=paranoid)
340 return b'"%s"' % encoding.jsonescape(obj, paranoid=paranoid)
@@ -9,7 +9,6 b''
9 import struct
9 import struct
10 import sys
10 import sys
11
11
12 from .. import pycompat
13
12
14 # Very short very of RFC 7049...
13 # Very short very of RFC 7049...
15 #
14 #
@@ -207,7 +206,7 b' def streamencodenone(v):'
207 STREAM_ENCODERS = {
206 STREAM_ENCODERS = {
208 bytes: streamencodebytestring,
207 bytes: streamencodebytestring,
209 int: streamencodeint,
208 int: streamencodeint,
210 pycompat.long: streamencodeint,
209 int: streamencodeint,
211 list: streamencodearray,
210 list: streamencodearray,
212 tuple: streamencodearray,
211 tuple: streamencodearray,
213 dict: streamencodemap,
212 dict: streamencodemap,
General Comments 0
You need to be logged in to leave comments. Login now