Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Match the parent signature for connectionLost.
Browse files Browse the repository at this point in the history
  • Loading branch information
clokep committed Mar 15, 2021
1 parent 63e5e33 commit 06d09af
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions synapse/http/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
IResolutionReceiver,
ITCPTransport,
)
from twisted.internet.protocol import connectionDone
from twisted.internet.task import Cooperator
from twisted.python.failure import Failure
from twisted.web._newclient import ResponseDone
Expand Down Expand Up @@ -780,7 +781,7 @@ def _maybe_fail(self):
def dataReceived(self, data: bytes) -> None:
self._maybe_fail()

def connectionLost(self, reason: Failure) -> None:
def connectionLost(self, reason: Failure = connectionDone) -> None:
self._maybe_fail()


Expand Down Expand Up @@ -814,7 +815,7 @@ def dataReceived(self, data: bytes) -> None:
assert self.transport is not None
self.transport.abortConnection()

def connectionLost(self, reason: Failure) -> None:
def connectionLost(self, reason: Failure = connectionDone) -> None:
# If the maximum size was already exceeded, there's nothing to do.
if self.deferred.called:
return
Expand Down

0 comments on commit 06d09af

Please sign in to comment.