diff options
author | Sean B. Palmer <http://inamidst.com/sbp/> | 2008-03-02 15:50:05 +0000 |
---|---|---|
committer | Sean B. Palmer <http://inamidst.com/sbp/> | 2008-03-02 15:50:05 +0000 |
commit | 16ec61f4d657f23d1e2361f86aeece31c74b84c3 (patch) | |
tree | 1dc13b8f74eca5732ee1926a9750878aa4a1f80f /irc.py | |
parent | f81eae836d70efa96847bf7060389755861a5dc2 (diff) | |
download | bot-16ec61f4d657f23d1e2361f86aeece31c74b84c3.tar.gz bot-16ec61f4d657f23d1e2361f86aeece31c74b84c3.tar.bz2 bot-16ec61f4d657f23d1e2361f86aeece31c74b84c3.zip |
Thread exiting elegance.
Diffstat (limited to 'irc.py')
-rwxr-xr-x | irc.py | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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: |