diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2023-10-04 13:53:04 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-04 13:53:04 -0400 |
commit | ab9c1e8f3951dcdb9d628b7ed155de543c046c44 (patch) | |
tree | 0e8f8faecdcab239aae6feef3d37aff8581d454f /synmark/__init__.py | |
parent | Some refactors around receipts stream (#16426) (diff) | |
download | synapse-ab9c1e8f3951dcdb9d628b7ed155de543c046c44.tar.xz |
Add type hints to synmark. (#16421)
Diffstat (limited to 'synmark/__init__.py')
-rw-r--r-- | synmark/__init__.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/synmark/__init__.py b/synmark/__init__.py index 2cc00b0f03..f213319542 100644 --- a/synmark/__init__.py +++ b/synmark/__init__.py @@ -13,15 +13,18 @@ # limitations under the License. import sys +from typing import cast + +from synapse.types import ISynapseReactor try: from twisted.internet.epollreactor import EPollReactor as Reactor except ImportError: - from twisted.internet.pollreactor import PollReactor as Reactor + from twisted.internet.pollreactor import PollReactor as Reactor # type: ignore[assignment] from twisted.internet.main import installReactor -def make_reactor(): +def make_reactor() -> ISynapseReactor: """ Instantiate and install a Twisted reactor suitable for testing (i.e. not the default global one). @@ -32,4 +35,4 @@ def make_reactor(): del sys.modules["twisted.internet.reactor"] installReactor(reactor) - return reactor + return cast(ISynapseReactor, reactor) |