equal
deleted
inserted
replaced
48 def json_dumps(value): |
48 def json_dumps(value): |
49 return dumps(value, cls=CubicWebJsonEncoder) |
49 return dumps(value, cls=CubicWebJsonEncoder) |
50 |
50 |
51 def jsonize(function): |
51 def jsonize(function): |
52 def newfunc(*args, **kwargs): |
52 def newfunc(*args, **kwargs): |
|
53 value = function(*args, **kwargs) |
53 try: |
54 try: |
54 value = function(*args, **kwargs) |
|
55 return json_dumps(value) |
55 return json_dumps(value) |
56 except TypeError: |
56 except TypeError: |
57 return json_dumps(repr(value)) |
57 return json_dumps(repr(value)) |
58 return newfunc |
58 return newfunc |
59 |
59 |