From faf3d299705179e4768fb8ed89f8529a8956b73c Mon Sep 17 00:00:00 2001 From: jcao219 Date: Thu, 11 Aug 2011 13:29:54 -0500 Subject: [PATCH] fixed error that sometimes happen when fdie is used --- oyoyo/client.py | 1 - wolfgame.py | 11 +++-------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/oyoyo/client.py b/oyoyo/client.py index 2949b3b..3cc1b35 100644 --- a/oyoyo/client.py +++ b/oyoyo/client.py @@ -229,7 +229,6 @@ class IRCClient(object): if self.socket: logging.info('closing socket') self.socket.close() - raise SystemExit # lets exit def msg(self, user, msg): for line in msg.split('\n'): self.send("PRIVMSG", user, ":{0}".format(line)) diff --git a/wolfgame.py b/wolfgame.py index fbcff82..f0e59c2 100644 --- a/wolfgame.py +++ b/wolfgame.py @@ -180,12 +180,7 @@ def forced_exit(cli, nick, *rest): # Admin Only else: reset(cli) - reset(cli) - dict.clear(COMMANDS) - dict.clear(PM_COMMANDS) - dict.clear(HOOKS) cli.quit("Forced quit from "+nick) - raise SystemExit @@ -198,9 +193,7 @@ def restart_program(cli, nick, *rest): stop_game(cli) else: reset(cli) - dict.clear(COMMANDS) - dict.clear(PM_COMMANDS) - dict.clear(HOOKS) + cli.quit("Forced restart from "+nick) raise SystemExit finally: @@ -2042,6 +2035,8 @@ def start(cli, nick, chan, rest): def on_error(cli, pfx, msg): if msg.endswith("(Excess Flood)"): restart_program(cli, "excess flood") + elif msg.endswith("(Client Quit)"): + raise SystemExit