diff options
author | Amber Brown <hawkowl@atleastfornow.net> | 2019-10-02 05:29:01 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-02 05:29:01 -0700 |
commit | 864f14454322c6cba11476667ade8fc6cbea6f44 (patch) | |
tree | c50252079f4cdf0ac2fc9c1193176590ed64e6ab /synapse/config/server.py | |
parent | Fix yields and copy instead of move push rules on room upgrade (#6144) (diff) | |
download | synapse-864f14454322c6cba11476667ade8fc6cbea6f44.tar.xz |
Fix up some typechecking (#6150)
* type checking fixes * changelog
Diffstat (limited to 'synapse/config/server.py')
-rw-r--r-- | synapse/config/server.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/synapse/config/server.py b/synapse/config/server.py index 536ee7f29c..709bd387e5 100644 --- a/synapse/config/server.py +++ b/synapse/config/server.py @@ -19,6 +19,7 @@ import logging import os.path import re from textwrap import indent +from typing import List import attr import yaml @@ -243,7 +244,7 @@ class ServerConfig(Config): # events with profile information that differ from the target's global profile. self.allow_per_room_profiles = config.get("allow_per_room_profiles", True) - self.listeners = [] + self.listeners = [] # type: List[dict] for listener in config.get("listeners", []): if not isinstance(listener.get("port", None), int): raise ConfigError( @@ -287,7 +288,10 @@ class ServerConfig(Config): validator=attr.validators.instance_of(bool), default=False ) complexity = attr.ib( - validator=attr.validators.instance_of((int, float)), default=1.0 + validator=attr.validators.instance_of( + (float, int) # type: ignore[arg-type] # noqa + ), + default=1.0, ) complexity_error = attr.ib( validator=attr.validators.instance_of(str), @@ -366,7 +370,7 @@ class ServerConfig(Config): "cleanup_extremities_with_dummy_events", True ) - def has_tls_listener(self): + def has_tls_listener(self) -> bool: return any(l["tls"] for l in self.listeners) def generate_config_section( |