Support PyPy

This commit is contained in:
TimePath 2016-04-10 18:30:56 +10:00
parent 5fbdf2bcec
commit 06602461e7
17 changed files with 22 additions and 22 deletions

View file

@ -15,7 +15,7 @@
from synapse.api.errors import SynapseError
from synapse.types import UserID, RoomID
import ujson as json
import json
class Filtering(object):

View file

@ -25,7 +25,7 @@ from synapse.types import UserID
import logging
from collections import namedtuple
import ujson as json
import json
logger = logging.getLogger(__name__)

View file

@ -34,7 +34,7 @@ from twisted.web.util import redirectTo
import collections
import logging
import urllib
import ujson
import json
logger = logging.getLogger(__name__)
@ -333,7 +333,7 @@ def respond_with_json(request, code, json_object, send_cors=False,
json_bytes = encode_canonical_json(json_object)
else:
# ujson doesn't like frozen_dicts.
json_bytes = ujson.dumps(json_object, ensure_ascii=False)
json_bytes = json.dumps(json_object, ensure_ascii=False)
return respond_with_json_bytes(
request, code, json_bytes,

View file

@ -14,7 +14,7 @@
# limitations under the License.
import logging
import ujson as json
import json
from twisted.internet import defer

View file

@ -32,9 +32,9 @@ REQUIREMENTS = {
"py-bcrypt": ["bcrypt"],
"pillow": ["PIL"],
"pydenticon": ["pydenticon"],
"ujson": ["ujson"],
"blist": ["blist"],
"pysaml2>=3.0.0,<4.0.0": ["saml2>=3.0.0,<4.0.0"],
# "ujson": ["ujson"], # json
"sortedcontainers": ["sortedcontainers"],
"pysaml2==4.0.3": ["saml2==4.0.3"],
"pymacaroons-pynacl": ["pymacaroons"],
}
CONDITIONAL_REQUIREMENTS = {

View file

@ -20,7 +20,7 @@ from twisted.web.resource import Resource
from twisted.web.server import NOT_DONE_YET
from twisted.internet import defer
import ujson as json
import json
import collections
import logging

View file

@ -32,7 +32,7 @@ import copy
import itertools
import logging
import ujson as json
import json
logger = logging.getLogger(__name__)

View file

@ -16,7 +16,7 @@
from ._base import SQLBaseStore
from twisted.internet import defer
import ujson as json
import json
import logging
logger = logging.getLogger(__name__)

View file

@ -17,7 +17,7 @@ from ._base import SQLBaseStore
from twisted.internet import defer
import ujson as json
import json
import logging
logger = logging.getLogger(__name__)

View file

@ -18,7 +18,7 @@ from twisted.internet import defer
from synapse.util.caches.descriptors import cachedInlineCallbacks
import logging
import ujson as json
import json
logger = logging.getLogger(__name__)

View file

@ -28,7 +28,7 @@ from contextlib import contextmanager
import logging
import math
import ujson as json
import json
logger = logging.getLogger(__name__)

View file

@ -20,7 +20,7 @@ from synapse.util.caches.stream_change_cache import StreamChangeCache
from twisted.internet import defer
import logging
import ujson as json
import json
logger = logging.getLogger(__name__)

View file

@ -17,7 +17,7 @@ import logging
from synapse.storage.prepare_database import get_statements
from synapse.storage.engines import PostgresEngine, Sqlite3Engine
import ujson
import json
logger = logging.getLogger(__name__)
@ -66,7 +66,7 @@ def run_upgrade(cur, database_engine, *args, **kwargs):
"max_stream_id_exclusive": max_stream_id + 1,
"rows_inserted": 0,
}
progress_json = ujson.dumps(progress)
progress_json = json.dumps(progress)
sql = (
"INSERT into background_updates (update_name, progress_json)"

View file

@ -16,7 +16,7 @@ import logging
from synapse.storage.prepare_database import get_statements
import ujson
import json
logger = logging.getLogger(__name__)
@ -45,7 +45,7 @@ def run_upgrade(cur, database_engine, *args, **kwargs):
"max_stream_id_exclusive": max_stream_id + 1,
"rows_inserted": 0,
}
progress_json = ujson.dumps(progress)
progress_json = json.dumps(progress)
sql = (
"INSERT into background_updates (update_name, progress_json)"

View file

@ -17,7 +17,7 @@ from ._base import SQLBaseStore
from synapse.util.caches.descriptors import cached
from twisted.internet import defer
import ujson as json
import json
import logging
logger = logging.getLogger(__name__)

View file

@ -16,7 +16,7 @@
from synapse.util.caches import cache_counter, caches_by_name
from blist import sorteddict
from sortedcontainers import SortedDict as sorteddict
import logging
import os

View file

@ -1,5 +1,5 @@
[tox]
envlist = packaging, py27, pep8
envlist = packaging, py27, pypy, pep8
[testenv]
deps =