From eb2db607eaba1b15de12617471822dfb56638625 Mon Sep 17 00:00:00 2001 From: Craig Rodrigues Date: Tue, 16 Jun 2020 10:40:44 -0700 Subject: [PATCH 1/2] Remove _connDone parameter from FileDescriptor.loseConnection() This is needed to make the loseConnection() match the signature in the baseclass ConnectionMixin. --- src/twisted/internet/abstract.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/twisted/internet/abstract.py b/src/twisted/internet/abstract.py index 0b046073dff..63a37a5641a 100644 --- a/src/twisted/internet/abstract.py +++ b/src/twisted/internet/abstract.py @@ -377,7 +377,7 @@ def writeSequence(self, iovec): self.startWriting() - def loseConnection(self, _connDone=failure.Failure(main.CONNECTION_DONE)): + def loseConnection(self): """Close the connection at the next available opportunity. Call this to cause this FileDescriptor to lose its connection. It will @@ -396,7 +396,7 @@ def loseConnection(self, _connDone=failure.Failure(main.CONNECTION_DONE)): # doWrite won't trigger the connection close anymore self.stopReading() self.stopWriting() - self.connectionLost(_connDone) + self.connectionLost(failure.Failure(main.CONNECTION_DONE)) else: self.stopReading() self.startWriting() From 3d0774fe2520ee2a1e0a273bb453c22054f05707 Mon Sep 17 00:00:00 2001 From: Craig Rodrigues Date: Tue, 16 Jun 2020 10:43:00 -0700 Subject: [PATCH 2/2] Add newsfragment --- src/twisted/newsfragments/9849.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 src/twisted/newsfragments/9849.bugfix diff --git a/src/twisted/newsfragments/9849.bugfix b/src/twisted/newsfragments/9849.bugfix new file mode 100644 index 00000000000..04ad642b2d1 --- /dev/null +++ b/src/twisted/newsfragments/9849.bugfix @@ -0,0 +1 @@ +The _connDone parameter has been removed from twisted.internet.abstract.FileDescriptor.loseConnection()'s signature in order to match the signature in the base class twisted.internet._newtls.ConnectionMixin loseConnection().