Squash error on fdie/frestart

oyoyo already closes the socket as part of a finally block, we don't
need to also do that.
This commit is contained in:
skizzerz 2016-08-17 17:14:53 -05:00
parent af2fef5ea9
commit d5d30eb6ae

View File

@ -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