forked from MirrorHub/synapse
Directly import json from the standard library. (#8259)
By importing from canonicaljson the simplejson module was still being used in some situations. After this change the std lib json is consistenty used throughout Synapse.
This commit is contained in:
parent
cef00211c8
commit
72bec36d50
5 changed files with 7 additions and 6 deletions
1
changelog.d/8259.misc
Normal file
1
changelog.d/8259.misc
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Switch to the JSON implementation from the standard library.
|
|
@ -15,10 +15,10 @@
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
import json
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
import jsonschema
|
import jsonschema
|
||||||
from canonicaljson import json
|
|
||||||
from jsonschema import FormatChecker
|
from jsonschema import FormatChecker
|
||||||
|
|
||||||
from synapse.api.constants import EventContentFields
|
from synapse.api.constants import EventContentFields
|
||||||
|
|
|
@ -14,13 +14,12 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
import argparse
|
import argparse
|
||||||
|
import json
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
from canonicaljson import json
|
|
||||||
|
|
||||||
from twisted.internet import defer, task
|
from twisted.internet import defer, task
|
||||||
|
|
||||||
import synapse
|
import synapse
|
||||||
|
|
|
@ -13,11 +13,11 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
import json
|
||||||
import logging
|
import logging
|
||||||
import re
|
import re
|
||||||
|
|
||||||
import attr
|
import attr
|
||||||
from canonicaljson import json
|
|
||||||
|
|
||||||
from twisted.internet import defer, task
|
from twisted.internet import defer, task
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,8 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from canonicaljson import json
|
import json
|
||||||
|
|
||||||
from frozendict import frozendict
|
from frozendict import frozendict
|
||||||
|
|
||||||
|
|
||||||
|
@ -66,5 +67,5 @@ def _handle_frozendict(obj):
|
||||||
# A JSONEncoder which is capable of encoding frozendicts without barfing.
|
# A JSONEncoder which is capable of encoding frozendicts without barfing.
|
||||||
# Additionally reduce the whitespace produced by JSON encoding.
|
# Additionally reduce the whitespace produced by JSON encoding.
|
||||||
frozendict_json_encoder = json.JSONEncoder(
|
frozendict_json_encoder = json.JSONEncoder(
|
||||||
default=_handle_frozendict, separators=(",", ":"),
|
allow_nan=False, separators=(",", ":"), default=_handle_frozendict,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue