Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maunium
synapse
Commits
2c1e1b15
Unverified
Commit
2c1e1b15
authored
4 years ago
by
Patrick Cloke
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Use the JSON module from the std library instead of simplejson. (#7936)
parent
8078dec3
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
changelog.d/7936.misc
+1
-0
1 addition, 0 deletions
changelog.d/7936.misc
synapse/__init__.py
+12
-0
12 additions, 0 deletions
synapse/__init__.py
synapse/python_dependencies.py
+1
-1
1 addition, 1 deletion
synapse/python_dependencies.py
with
14 additions
and
1 deletion
changelog.d/7936.misc
0 → 100644
+
1
−
0
View file @
2c1e1b15
Switch to the JSON implementation from the standard library and bump the minimum version of the canonicaljson library to 1.2.0.
This diff is collapsed.
Click to expand it.
synapse/__init__.py
+
12
−
0
View file @
2c1e1b15
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
"""
This is a reference implementation of a Matrix homeserver.
"""
This is a reference implementation of a Matrix homeserver.
"""
"""
import
json
import
os
import
os
import
sys
import
sys
...
@@ -25,6 +26,9 @@ if sys.version_info < (3, 5):
...
@@ -25,6 +26,9 @@ if sys.version_info < (3, 5):
print
(
"
Synapse requires Python 3.5 or above.
"
)
print
(
"
Synapse requires Python 3.5 or above.
"
)
sys
.
exit
(
1
)
sys
.
exit
(
1
)
# Twisted and canonicaljson will fail to import when this file is executed to
# get the __version__ during a fresh install. That's OK and subsequent calls to
# actually start Synapse will import these libraries fine.
try
:
try
:
from
twisted.internet
import
protocol
from
twisted.internet
import
protocol
from
twisted.internet.protocol
import
Factory
from
twisted.internet.protocol
import
Factory
...
@@ -36,6 +40,14 @@ try:
...
@@ -36,6 +40,14 @@ try:
except
ImportError
:
except
ImportError
:
pass
pass
# Use the standard library json implementation instead of simplejson.
try
:
from
canonicaljson
import
set_json_library
set_json_library
(
json
)
except
ImportError
:
pass
__version__
=
"
1.18.0rc2
"
__version__
=
"
1.18.0rc2
"
if
bool
(
os
.
environ
.
get
(
"
SYNAPSE_TEST_PATCH_LOG_CONTEXTS
"
,
False
)):
if
bool
(
os
.
environ
.
get
(
"
SYNAPSE_TEST_PATCH_LOG_CONTEXTS
"
,
False
)):
...
...
This diff is collapsed.
Click to expand it.
synapse/python_dependencies.py
+
1
−
1
View file @
2c1e1b15
...
@@ -43,7 +43,7 @@ REQUIREMENTS = [
...
@@ -43,7 +43,7 @@ REQUIREMENTS = [
"
jsonschema>=2.5.1
"
,
"
jsonschema>=2.5.1
"
,
"
frozendict>=1
"
,
"
frozendict>=1
"
,
"
unpaddedbase64>=1.1.0
"
,
"
unpaddedbase64>=1.1.0
"
,
"
canonicaljson>=1.
1.3
"
,
"
canonicaljson>=1.
2.0
"
,
# we use the type definitions added in signedjson 1.1.
# we use the type definitions added in signedjson 1.1.
"
signedjson>=1.1.0
"
,
"
signedjson>=1.1.0
"
,
"
pynacl>=1.2.1
"
,
"
pynacl>=1.2.1
"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment