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

Commit

Permalink
Ignore the jsonschema type. (#11817)
Browse files Browse the repository at this point in the history
  • Loading branch information
clokep authored and babolivier committed Jan 26, 2022
1 parent ffd8dba commit c09e232
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
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

0 comments on commit c09e232

Please sign in to comment.