From 6c0984e3f007de469af74d8b6a432c8704633b03 Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Tue, 8 Feb 2022 09:15:59 -0500 Subject: [PATCH] Remove unnecessary ignores due to Twisted upgrade. (#11939) Twisted 22.1.0 fixed some internal type hints, allowing Synapse to remove ignore calls for parameters to connectTCP. --- changelog.d/11939.misc | 1 + synapse/handlers/send_email.py | 2 +- synapse/replication/tcp/handler.py | 4 ++-- synapse/replication/tcp/redis.py | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 changelog.d/11939.misc diff --git a/changelog.d/11939.misc b/changelog.d/11939.misc new file mode 100644 index 000000000..317526f9e --- /dev/null +++ b/changelog.d/11939.misc @@ -0,0 +1 @@ +Remove an unnecessary ignoring of type hints due to fixes in upstream packages. diff --git a/synapse/handlers/send_email.py b/synapse/handlers/send_email.py index 1a062a784..a305a6686 100644 --- a/synapse/handlers/send_email.py +++ b/synapse/handlers/send_email.py @@ -106,7 +106,7 @@ async def _sendmail( factory = build_sender_factory(hostname=smtphost if enable_tls else None) reactor.connectTCP( - smtphost, # type: ignore[arg-type] + smtphost, smtpport, factory, timeout=30, diff --git a/synapse/replication/tcp/handler.py b/synapse/replication/tcp/handler.py index 21293038e..f7e6bc1e6 100644 --- a/synapse/replication/tcp/handler.py +++ b/synapse/replication/tcp/handler.py @@ -318,7 +318,7 @@ class ReplicationCommandHandler: hs, outbound_redis_connection ) hs.get_reactor().connectTCP( - hs.config.redis.redis_host, # type: ignore[arg-type] + hs.config.redis.redis_host, hs.config.redis.redis_port, self._factory, timeout=30, @@ -330,7 +330,7 @@ class ReplicationCommandHandler: host = hs.config.worker.worker_replication_host port = hs.config.worker.worker_replication_port hs.get_reactor().connectTCP( - host, # type: ignore[arg-type] + host, port, self._factory, timeout=30, diff --git a/synapse/replication/tcp/redis.py b/synapse/replication/tcp/redis.py index 8d28bd3f3..5b37f379d 100644 --- a/synapse/replication/tcp/redis.py +++ b/synapse/replication/tcp/redis.py @@ -373,7 +373,7 @@ def lazyConnection( reactor = hs.get_reactor() reactor.connectTCP( - host, # type: ignore[arg-type] + host, port, factory, timeout=30,