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