mirror of https://github.com/celery/kombu.git
anyjson 0.3.2 now supports buffer objects, so pass them on
This commit is contained in:
parent
df7913860f
commit
c6360288ec
|
@ -286,9 +286,9 @@ def register_json():
|
|||
from anyjson import loads, dumps
|
||||
|
||||
def _loads(obj):
|
||||
if isinstance(obj, buffer):
|
||||
obj = str(obj)
|
||||
return loads(bytes_to_str(obj))
|
||||
if isinstance(obj, str):
|
||||
obj = bytes_to_str(obj)
|
||||
return loads(obj)
|
||||
|
||||
registry.register('json', dumps, _loads,
|
||||
content_type='application/json',
|
||||
|
|
Loading…
Reference in New Issue