diff --git a/src/wolfgame.py b/src/wolfgame.py index 2e73d88..a747f72 100644 --- a/src/wolfgame.py +++ b/src/wolfgame.py @@ -440,9 +440,6 @@ def forced_exit(cli, nick, chan, rest): # the operator should see this on console anyway even though it isn't logged traceback.print_exc() sys.exit() - finally: - cli.socket.close() # in case it didn't close, force it to - def _restart_program(cli, mode=None): plog("RESTARTING") @@ -514,11 +511,8 @@ def restart_program(cli, nick, chan, rest): nick, _, __, host = parse_nick(raw_nick) # restart the bot once our quit message goes though to ensure entire IRC queue is sent # if the bot is using a nick that isn't botconfig.NICK, then stop breaking things and fdie - try: - if nick == botconfig.NICK: - _restart_program(cli, mode) - finally: - cli.socket.close() + if nick == botconfig.NICK: + _restart_program(cli, mode) # This is checked in the on_error handler. Some IRCds, such as InspIRCd, don't send the bot # its own QUIT message, so we need to use ERROR. Ideally, we shouldn't even need the above