summary refs log tree commit diff
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2022-01-25 06:07:10 -0500
committerBrendan Abolivier <babolivier@matrix.org>2022-01-26 17:35:09 +0000
commitc09e2326dc06ea4de62ea1cc0275a6e40885f5ab (patch)
treef15c31163c2a6804cafe465bb22664dc103f7940
parentAvoid type annotation problems in prom-client (#11834) (diff)
downloadsynapse-c09e2326dc06ea4de62ea1cc0275a6e40885f5ab.tar.xz
Ignore the jsonschema type. (#11817)
-rw-r--r--changelog.d/11817.misc1
-rw-r--r--synapse/events/validator.py4
2 files changed, 4 insertions, 1 deletions
diff --git a/changelog.d/11817.misc b/changelog.d/11817.misc
new file mode 100644
index 0000000000..bd29d8d6eb
--- /dev/null
+++ b/changelog.d/11817.misc
@@ -0,0 +1 @@
+Compatibility with updated type hints for jsonschema 4.4.0.
diff --git a/synapse/events/validator.py b/synapse/events/validator.py
index cf86934968..4245573017 100644
--- a/synapse/events/validator.py
+++ b/synapse/events/validator.py
@@ -246,7 +246,9 @@ POWER_LEVELS_SCHEMA = {
 
 # 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