##// END OF EJS Templates
json: avoid extra string manipulation of dict keys...
Yuya Nishihara -
r32742:08d0892c default
parent child Browse files
Show More
@@ -234,7 +234,7 b' def json(obj, paranoid=True):'
234 234 elif isinstance(obj, bytes):
235 235 return '"%s"' % encoding.jsonescape(obj, paranoid=paranoid)
236 236 elif util.safehasattr(obj, 'keys'):
237 out = ['%s: %s' % (json(k), json(v))
237 out = ['"%s": %s' % (encoding.jsonescape(k, paranoid=paranoid), json(v))
238 238 for k, v in sorted(obj.iteritems())]
239 239 return '{' + ', '.join(out) + '}'
240 240 elif util.safehasattr(obj, '__iter__'):
General Comments 0
You need to be logged in to leave comments. Login now