Made the error message in the face of problems connecting much prettier.

This commit is contained in:
Jeremy Fincher 2003-08-25 07:24:31 +00:00
parent eb7b696ce9
commit 56117a0662

View File

@ -62,9 +62,13 @@ class ThreadedFunCommands(callbacks.Privmsg):
def kernel(self, irc, msg, args):
"""takes no arguments"""
conn = telnetlib.Telnet('kernel.org', 79)
conn.write('\n')
text = conn.read_all()
try:
conn = telnetlib.Telnet('kernel.org', 79)
conn.write('\n')
text = conn.read_all()
except socket.error, e:
irc.error(msg, e.args[1])
return
stable = 'unkown'
beta = 'unknown'
for line in text.splitlines():