From 3a30846bd088bbfecd9ddfa1ee82a6951670ade7 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Thu, 11 Apr 2024 16:03:45 +0100 Subject: Fix mypy on latest Twisted release (#17036) `ITransport.abortConnection` isn't a thing, but `HTTPChannel.forceAbortClient` calls it, so lets just use that Fixes https://github.com/element-hq/synapse/issues/16728 --- synapse/http/server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'synapse/http/server.py') diff --git a/synapse/http/server.py b/synapse/http/server.py index 632284712c..c76500e14f 100644 --- a/synapse/http/server.py +++ b/synapse/http/server.py @@ -153,9 +153,9 @@ def return_json_error( # Only respond with an error response if we haven't already started writing, # otherwise lets just kill the connection if request.startedWriting: - if request.transport: + if request.channel: try: - request.transport.abortConnection() + request.channel.forceAbortClient() except Exception: # abortConnection throws if the connection is already closed pass -- cgit 1.5.1