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): def kernel(self, irc, msg, args):
"""takes no arguments""" """takes no arguments"""
conn = telnetlib.Telnet('kernel.org', 79) try:
conn.write('\n') conn = telnetlib.Telnet('kernel.org', 79)
text = conn.read_all() conn.write('\n')
text = conn.read_all()
except socket.error, e:
irc.error(msg, e.args[1])
return
stable = 'unkown' stable = 'unkown'
beta = 'unknown' beta = 'unknown'
for line in text.splitlines(): for line in text.splitlines():