Skip to content

Commit

Permalink
Merge pull request #1292 from twisted/9849-rodrigc-loseconnection-mypy
Browse files Browse the repository at this point in the history
Remove _connDone parameter from FileDescriptor.loseConnection()

Author: rodrigc
Reviewer: adiroiban
Fixes: ticket:9849
  • Loading branch information
rodrigc committed Jun 16, 2020
2 parents f163682 + 4fd90d8 commit a0754eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/twisted/internet/abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
Expand Down
1 change: 1 addition & 0 deletions src/twisted/newsfragments/9849.bugfix
Original file line number Diff line number Diff line change
@@ -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().

0 comments on commit a0754eb

Please sign in to comment.