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

Commit c09e232

Browse files
clokepbabolivier
authored andcommitted
Ignore the jsonschema type. (#11817)
1 parent ffd8dba commit c09e232

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

changelog.d/11817.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Compatibility with updated type hints for jsonschema 4.4.0.

synapse/events/validator.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,9 @@ def _ensure_state_event(self, event: Union[EventBase, EventBuilder]) -> None:
246246

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

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

0 commit comments

Comments
 (0)