Skip to content

Commit

Permalink
.connectionLost should be called with a Failure, not an Exception.
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.twistedmatrix.com/svn/Twisted/trunk@12585 bbbe8e31-12d6-0310-92fd-ac37d47ddeeb
  • Loading branch information
jyknight committed Nov 24, 2004
1 parent 252e48e commit 081d393
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions twisted/internet/abstract.py
Expand Up @@ -14,11 +14,11 @@
from zope.interface import implements

# Twisted Imports
from twisted.python import log, reflect, components
from twisted.python import log, reflect, components, failure
from twisted.persisted import styles

# Sibling Imports
import interfaces
import interfaces, main

class FileDescriptor(log.Logger, styles.Ephemeral):
"""An object which can be operated on by select().
Expand Down Expand Up @@ -192,7 +192,7 @@ def writeSequence(self, iovec):
self.producer.pauseProducing()
self.startWriting()

def loseConnection(self):
def loseConnection(self, _connDone=failure.Failure(main.CONNECTION_DONE)):
"""Close the connection at the next available opportunity.
Call this to cause this FileDescriptor to lose its connection; if this is in
Expand All @@ -209,7 +209,7 @@ def loseConnection(self):
# doWrite won't trigger the connection close anymore
self.stopReading()
self.stopWriting()
self.connectionLost(main.CONNECTION_DONE)
self.connectionLost(_connDone)
else:
self.stopReading()
self.startWriting()
Expand Down Expand Up @@ -333,8 +333,4 @@ def isIPAddress(addr):
pass
return 0

# Sibling Imports
import main


__all__ = ["FileDescriptor"]

0 comments on commit 081d393

Please sign in to comment.