Skip to content
This repository has been archived by the owner on Mar 28, 2019. It is now read-only.

Commit

Permalink
@leplatrem review.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rémy HUBSCHER committed Nov 3, 2015
1 parent de610e6 commit 90ebf61
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 1 addition & 2 deletions cliquet/initialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ def setup_json_serializer(config):
requests.models.json = utils.json

# Override json renderer using ujson
renderer = JSONRenderer(serializer=lambda v, **kw: utils.json.dumps(
v, escape_forward_slashes=False))
renderer = JSONRenderer(serializer=utils.json_serializer)
config.add_renderer('json', renderer)


Expand Down
7 changes: 6 additions & 1 deletion cliquet/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,19 @@
import time
from base64 import b64decode, b64encode
from binascii import hexlify
from functools import partial
from six.moves.urllib import parse as urlparse

# ujson is not installable with pypy
# ultrajson is not installable with pypy
try:
import ultrajson as json # NOQA

json_serializer = partial(json.dumps, escape_forward_slashes=False)
except ImportError: # pragma: no cover
import json # NOQA

json_serializer = json.dumps

try:
# Register psycopg2cffi as psycopg2
from psycopg2cffi import compat
Expand Down

0 comments on commit 90ebf61

Please sign in to comment.