diff options
author | Sean Quah <8349537+squahtx@users.noreply.github.com> | 2021-10-22 18:15:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-22 18:15:41 +0100 |
commit | 2b82ec425fccb0ef626242779f7ccd4d77a0685c (patch) | |
tree | d541487cf7936d98807c5b1ef5128bb1bb5c783c /synapse/replication/http/_base.py | |
parent | Fix synapse.config module "read" command (#11145) (diff) | |
download | synapse-2b82ec425fccb0ef626242779f7ccd4d77a0685c.tar.xz |
Add type hints for most `HomeServer` parameters (#11095)
Diffstat (limited to 'synapse/replication/http/_base.py')
-rw-r--r-- | synapse/replication/http/_base.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/synapse/replication/http/_base.py b/synapse/replication/http/_base.py index e047ec74d8..585332b244 100644 --- a/synapse/replication/http/_base.py +++ b/synapse/replication/http/_base.py @@ -17,7 +17,7 @@ import logging import re import urllib from inspect import signature -from typing import TYPE_CHECKING, Dict, List, Tuple +from typing import TYPE_CHECKING, Any, Awaitable, Callable, Dict, List, Tuple from prometheus_client import Counter, Gauge @@ -156,7 +156,7 @@ class ReplicationEndpoint(metaclass=abc.ABCMeta): pass @classmethod - def make_client(cls, hs): + def make_client(cls, hs: "HomeServer"): """Create a client that makes requests. Returns a callable that accepts the same parameters as @@ -208,7 +208,9 @@ class ReplicationEndpoint(metaclass=abc.ABCMeta): url_args.append(txn_id) if cls.METHOD == "POST": - request_func = client.post_json_get_json + request_func: Callable[ + ..., Awaitable[Any] + ] = client.post_json_get_json elif cls.METHOD == "PUT": request_func = client.put_json elif cls.METHOD == "GET": |