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

Ignore the jsonschema type. #11817

Merged
merged 1 commit into from
Jan 25, 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/11817.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Compatibility with updated type hints for jsonschema 4.4.0.
4 changes: 3 additions & 1 deletion synapse/events/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,9 @@ def _ensure_state_event(self, event: Union[EventBase, EventBuilder]) -> None:

# This could return something newer than Draft 7, but that's the current "latest"
# validator.
def _create_power_level_validator() -> jsonschema.Draft7Validator:
#
# See https://github.com/python/typeshed/issues/7028 for the ignored return type.
def _create_power_level_validator() -> jsonschema.Draft7Validator: # type: ignore[valid-type]
validator = jsonschema.validators.validator_for(POWER_LEVELS_SCHEMA)

# by default jsonschema does not consider a frozendict to be an object so
Expand Down