changeset 2817:3ae42e10b665 beta

fix ext-json extension issue when exception is raised for non-serializable objects
author Marcin Kuzminski <marcin@python-works.com>
date Thu, 06 Sep 2012 11:32:36 +0200
parents b80375835974
children 3d0bd5f71dab
files rhodecode/lib/ext_json.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/lib/ext_json.py	Thu Sep 06 00:43:44 2012 +0200
+++ b/rhodecode/lib/ext_json.py	Thu Sep 06 11:32:36 2012 +0200
@@ -92,7 +92,7 @@
                 return _obj_dump(obj)
             except NotImplementedError:
                 pass
-            return json.JSONEncoder.default(self, obj)
+            raise TypeError("%r is not JSON serializable" % (obj,))
     # monkey-patch JSON encoder to use extended version
     json.dumps = functools.partial(json.dumps, cls=ExtendedEncoder)
     json.dump = functools.partial(json.dump, cls=ExtendedEncoder)