Skip to content

Commit

Permalink
Only close the dispatcher if it hasn't already been closed. closes pi…
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyg committed May 17, 2010
1 parent 3d5c081 commit 20d3307
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pika/asyncore_adapter.py
Expand Up @@ -103,7 +103,8 @@ def connect(self, host, port):
self.dispatcher.connect((host, port or spec.PORT))

def disconnect_transport(self):
self.dispatcher.close()
if self.dispatcher:
self.dispatcher.close()

def drain_events(self):
loop(count = 1)
Expand Down

0 comments on commit 20d3307

Please sign in to comment.