From ca53fee3479216d60c718800706e48d54faf110d Mon Sep 17 00:00:00 2001 From: "A. Jesse Jiryu Davis" Date: Fri, 13 Dec 2013 18:21:08 -0500 Subject: [PATCH] Simplify json_util.default --- bson/json_util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bson/json_util.py b/bson/json_util.py index ea3e3dcd3..782b18ce7 100644 --- a/bson/json_util.py +++ b/bson/json_util.py @@ -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()),