Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Use the standard library JSON.
Browse files Browse the repository at this point in the history
  • Loading branch information
clokep committed Jul 23, 2020
1 parent ff22672 commit e695a1d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/7936.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Switch to the JSON implementation from the standard library.
6 changes: 6 additions & 0 deletions synapse/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@
""" This is a reference implementation of a Matrix homeserver.
"""

import json
import os
import sys

from canonicaljson import set_json_library

# Check that we're not running on an unsupported Python version.
if sys.version_info < (3, 5):
print("Synapse requires Python 3.5 or above.")
Expand All @@ -36,6 +39,9 @@
except ImportError:
pass

# Use the standard library json implementation instead of simplejson.
set_json_library(json)

__version__ = "1.17.0"

if bool(os.environ.get("SYNAPSE_TEST_PATCH_LOG_CONTEXTS", False)):
Expand Down
3 changes: 2 additions & 1 deletion synapse/python_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
"jsonschema>=2.5.1",
"frozendict>=1",
"unpaddedbase64>=1.1.0",
"canonicaljson>=1.1.3",
# TODO This will require canonicaljson >= 1.2.0.
"canonicaljson@https://github.com/matrix-org/python-canonicaljson/archive/clokep/chooseable-json.zip",
# we use the type definitions added in signedjson 1.1.
"signedjson>=1.1.0",
"pynacl>=1.2.1",
Expand Down

0 comments on commit e695a1d

Please sign in to comment.