# HG changeset patch # User Charly COSTE # Date 1267915055 -3600 # Node ID ca22fdea1c172da06145de5ff91c5e9d2def498d # Parent 45065f6f674c70cbff4335d7887b67bd1ef0fdc0 (irclib) minor fixes for 9e494bf91d13f165af272b7bef9422a4ea9100eb (auto-reconnection improvement) Signed-off-by: Charly COSTE diff --git a/irclib.py b/irclib.py --- a/irclib.py +++ b/irclib.py @@ -292,8 +292,12 @@ class IRC: break try: self.process_once(timeout) - except ServerNotConnectedError: - c = e.args[1] + except ServerNotConnectedError as e: + if len(e.args) > 0: + c = e.args[0] + else: + self.bot.error(say_levels.error, 'Unkonwn exception on IRC thread:\n'+str(e.args)) + continue if c.real_nickname == self.bot.nickname: self.bot.restart(message='Lost bot IRC connection') else: