equal
deleted
inserted
replaced
344 b'"%s": %s' |
344 b'"%s": %s' |
345 % (encoding.jsonescape(k, paranoid=paranoid), json(v, paranoid)) |
345 % (encoding.jsonescape(k, paranoid=paranoid), json(v, paranoid)) |
346 for k, v in sorted(obj.items()) |
346 for k, v in sorted(obj.items()) |
347 ] |
347 ] |
348 return b'{' + b', '.join(out) + b'}' |
348 return b'{' + b', '.join(out) + b'}' |
349 elif util.safehasattr(obj, b'__iter__'): |
349 elif util.safehasattr(obj, '__iter__'): |
350 out = [json(i, paranoid) for i in obj] |
350 out = [json(i, paranoid) for i in obj] |
351 return b'[' + b', '.join(out) + b']' |
351 return b'[' + b', '.join(out) + b']' |
352 raise error.ProgrammingError(b'cannot encode %r' % obj) |
352 raise error.ProgrammingError(b'cannot encode %r' % obj) |
353 |
353 |
354 |
354 |