Show More
@@ -249,13 +249,9 b' def json(obj, paranoid=True):' | |||
|
249 | 249 | return pycompat.bytestr(obj) |
|
250 | 250 | elif isinstance(obj, bytes): |
|
251 | 251 | return '"%s"' % encoding.jsonescape(obj, paranoid=paranoid) |
|
252 |
elif isinstance(obj, |
|
|
253 | # This branch is unreachable on Python 2, because bytes == str | |
|
254 | # and we'll return in the next-earlier block in the elif | |
|
255 | # ladder. On Python 3, this helps us catch bugs before they | |
|
256 | # hurt someone. | |
|
252 | elif isinstance(obj, type(u'')): | |
|
257 | 253 | raise error.ProgrammingError( |
|
258 |
'Mercurial only does output with bytes |
|
|
254 | 'Mercurial only does output with bytes: %r' % obj) | |
|
259 | 255 | elif util.safehasattr(obj, 'keys'): |
|
260 | 256 | out = ['"%s": %s' % (encoding.jsonescape(k, paranoid=paranoid), |
|
261 | 257 | json(v, paranoid)) |
General Comments 0
You need to be logged in to leave comments.
Login now