changeset 218:ca22fdea1c17

(irclib) minor fixes for 9e494bf91d13f165af272b7bef9422a4ea9100eb (auto-reconnection improvement) Signed-off-by: Charly COSTE <changaco@changaco.net>
author Charly COSTE <changaco@changaco.net>
date Sat, 06 Mar 2010 23:37:35 +0100
parents 45065f6f674c
children 63289aa1dea7
files irclib.py
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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: