Skip to content

Commit

Permalink
fixed incompatibility with older versions of twisted introduced with …
Browse files Browse the repository at this point in the history
…memory leak fix
  • Loading branch information
forrestv committed Feb 7, 2013
1 parent 6ff320b commit 27de695
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions p2pool/p2p.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def connectionMade(self):
def _connect_timeout(self):
self.timeout_delayed = None
print 'Handshake timed out, disconnecting from %s:%i' % self.addr
if self.transport.abortConnection is not None:
if hasattr(self.transport, 'abortConnection'):
# Available since Twisted 11.1
self.transport.abortConnection()
else:
Expand All @@ -106,7 +106,7 @@ def badPeerHappened(self):
def _timeout(self):
self.timeout_delayed = None
print 'Connection timed out, disconnecting from %s:%i' % self.addr
if self.transport.abortConnection is not None:
if hasattr(self.transport, 'abortConnection'):
# Available since Twisted 11.1
self.transport.abortConnection()
else:
Expand Down

0 comments on commit 27de695

Please sign in to comment.