Simplify json_util.default

This commit is contained in:
A. Jesse Jiryu Davis 2013-12-13 18:21:08 -05:00
parent 51deead4ff
commit ca53fee347

View File

@ -226,7 +226,7 @@ def default(obj):
if isinstance(obj, Timestamp):
return SON([("t", obj.time), ("i", obj.inc)])
if isinstance(obj, Code):
return SON([('$code', "%s" % obj), ('$scope', obj.scope)])
return SON([('$code', str(obj)), ('$scope', obj.scope)])
if isinstance(obj, Binary):
return SON([
('$binary', base64.b64encode(obj).decode()),