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

Fix mypy errors with latest canonicaljson #13905

Merged
merged 3 commits into from
Sep 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/13905.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix mypy errors with canonicaljson 1.6.3.
9 changes: 5 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions synapse/http/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ def stopProducing(self) -> None:
self._request = None


def _encode_json_bytes(json_object: Any) -> bytes:
def _encode_json_bytes(json_object: object) -> bytes:
"""
Encode an object into JSON. Returns an iterator of bytes.
"""
Expand Down Expand Up @@ -746,7 +746,7 @@ def respond_with_json(
return None

if canonical_json:
encoder = encode_canonical_json
encoder: Callable[[object], bytes] = encode_canonical_json
else:
encoder = _encode_json_bytes

Expand Down