From 2b990cd580dc101c6845c75f88f44b24576102ac Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Sat, 16 Apr 2011 16:00:49 -0400 Subject: [PATCH] testing a small fix --- core/main.py | 11 +++++------ irc/watcher.py | 3 +-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/core/main.py b/core/main.py index e04272e..bcf2889 100644 --- a/core/main.py +++ b/core/main.py @@ -30,7 +30,7 @@ def irc_watcher(f_conn): except: traceback.print_exc() time.sleep(5) # sleep a bit before restarting watcher - print "restarting watcher component..." + print "watcher has stopped; restarting component..." def run(): global f_conn @@ -42,9 +42,8 @@ def run(): frontend.main(f_conn) + w_conn.close() + f_conn.close() + if __name__ == "__main__": - try: - run() - finally: - f_conn.close() - w_conn.close() + run() diff --git a/irc/watcher.py b/irc/watcher.py index 1ab3a79..7e4a705 100644 --- a/irc/watcher.py +++ b/irc/watcher.py @@ -21,10 +21,9 @@ def main(connection, f_conn): read_buffer = str() while 1: - try: + try: read_buffer = read_buffer + connection.get() except RuntimeError: # socket broke - print "socket has broken on watcher, restarting component..." return lines = read_buffer.split("\n")