Thread exiting elegance.

This commit is contained in:
Sean B. Palmer
2008-03-02 15:50:05 +00:00
parent f81eae836d
commit 16ec61f4d6
2 changed files with 12 additions and 4 deletions

4
irc.py
View File

@@ -65,7 +65,9 @@ class Bot(asynchat.async_chat):
print >> sys.stderr, message,
self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
self.connect((host, port))
asyncore.loop()
try: asyncore.loop()
except KeyboardInterrupt:
sys.exit()
def handle_connect(self):
if self.verbose: