summaryrefslogtreecommitdiffstats
path: root/irc.py
diff options
context:
space:
mode:
authorSean B. Palmer <http://inamidst.com/sbp/>2008-03-02 15:50:05 +0000
committerSean B. Palmer <http://inamidst.com/sbp/>2008-03-02 15:50:05 +0000
commit16ec61f4d657f23d1e2361f86aeece31c74b84c3 (patch)
tree1dc13b8f74eca5732ee1926a9750878aa4a1f80f /irc.py
parentf81eae836d70efa96847bf7060389755861a5dc2 (diff)
downloadbot-16ec61f4d657f23d1e2361f86aeece31c74b84c3.tar.gz
bot-16ec61f4d657f23d1e2361f86aeece31c74b84c3.tar.bz2
bot-16ec61f4d657f23d1e2361f86aeece31c74b84c3.zip
Thread exiting elegance.
Diffstat (limited to 'irc.py')
-rwxr-xr-xirc.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/irc.py b/irc.py
index 89114af..38fe886 100755
--- a/irc.py
+++ b/irc.py
@@ -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: