irc: catch exception in gethostbyname
authorThomasV <thomasv@gitorious>
Tue, 19 Feb 2013 05:21:28 +0000 (09:21 +0400)
committerThomasV <thomasv@gitorious>
Tue, 19 Feb 2013 05:21:28 +0000 (09:21 +0400)
backends/irc/__init__.py

index 0e7b757..1efa97e 100644 (file)
@@ -96,7 +96,11 @@ class IrcThread(threading.Thread):
                     elif '352' in line:  # answer to /who
                         # warning: this is a horrible hack which apparently works
                         k = line.index('352')
-                        ip = socket.gethostbyname(line[k+4])
+                        try:
+                            ip = socket.gethostbyname(line[k+4])
+                        except:
+                            print_log("gethostbyname error", line[k+4])
+                            continue
                         name = line[k+6]
                         host = line[k+9]
                         ports = line[k+10:]