summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAsk Solem <ask@celeryproject.org>2014-05-29 12:36:35 +0100
committerAsk Solem <ask@celeryproject.org>2014-05-29 12:36:35 +0100
commit3d63c6762d27a094f9cbf7252102e75fc088409d (patch)
treeef83fcd2b24e151299ab45fd8c5e3a3936d58472
parent86274e967d900077f5e509d436d92f5a5db34b63 (diff)
downloadkombu-3d63c6762d27a094f9cbf7252102e75fc088409d.tar.gz
cosmetics
-rw-r--r--kombu/utils/json.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/kombu/utils/json.py b/kombu/utils/json.py
index 9dd03429..a5227467 100644
--- a/kombu/utils/json.py
+++ b/kombu/utils/json.py
@@ -17,14 +17,11 @@ class JSONEncoder(json.JSONEncoder):
def default(self, obj, _super=json.JSONEncoder.default):
try:
- _super(self, obj)
- except TypeError:
- try:
- reducer = obj.__json__
- except AttributeError:
- raise
- else:
- return reducer()
+ reducer = obj.__json__
+ except AttributeError:
+ return _super(self, obj)
+ else:
+ return reducer()
def dumps(s, _dumps=json.dumps, cls=JSONEncoder):