diff --git a/synapse/util/__init__.py b/synapse/util/__init__.py index 9f3b8741c1db..8d9df352b25f 100644 --- a/synapse/util/__init__.py +++ b/synapse/util/__init__.py @@ -93,7 +93,7 @@ class Clock: _reactor: IReactorTime = attr.ib() - @defer.inlineCallbacks # type: ignore[arg-type] # Issue in Twisted's type annotations + @defer.inlineCallbacks def sleep(self, seconds: float) -> "Generator[Deferred[float], Any, Any]": d: defer.Deferred[float] = defer.Deferred() with context.PreserveLoggingContext(): diff --git a/tests/http/__init__.py b/tests/http/__init__.py index d5306e7ee022..9108a3007b90 100644 --- a/tests/http/__init__.py +++ b/tests/http/__init__.py @@ -182,7 +182,7 @@ def wrap_server_factory_for_tls( ) else: return TLSMemoryBIOFactory( - connection_creator, isClient=False, wrappedFactory=factory, clock=clock # type: ignore[call-arg] + connection_creator, isClient=False, wrappedFactory=factory, clock=clock ) diff --git a/tests/server.py b/tests/server.py index cfb0fb823b07..c8342db399ab 100644 --- a/tests/server.py +++ b/tests/server.py @@ -484,7 +484,7 @@ def getHostByName( if twisted.version > Version("Twisted", 23, 8, 0): from twisted.protocols import tls - tls._get_default_clock = lambda: self # type: ignore[attr-defined] + tls._get_default_clock = lambda: self self.nameResolver = SimpleResolverComplexifier(FakeResolver()) super().__init__()