mirror of https://github.com/celery/kombu.git
cosmetics
This commit is contained in:
parent
86274e967d
commit
3d63c6762d
|
@ -16,13 +16,10 @@ IS_PY3 = sys.version_info[0] == 3
|
|||
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
|
||||
return _super(self, obj)
|
||||
else:
|
||||
return reducer()
|
||||
|
||||
|
|
Loading…
Reference in New Issue