Fixed handling of timeout on socket in Debian.version.

This commit is contained in:
Jeremy Fincher 2003-11-21 18:16:27 +00:00
parent cdda36f9fb
commit 10fe799033

View File

@ -40,6 +40,7 @@ import gzip
import sets import sets
import getopt import getopt
import popen2 import popen2
import socket
import urllib import urllib
import fnmatch import fnmatch
import os.path import os.path
@ -200,6 +201,12 @@ class Debian(callbacks.Privmsg, plugins.PeriodicFileDownloader):
except urllib2.HTTPError, e: except urllib2.HTTPError, e:
irc.error(msg, 'I couldn\'t reach the search page (%s).' % e) irc.error(msg, 'I couldn\'t reach the search page (%s).' % e)
return return
except socket.error, e:
if e.args[0] == 110:
irc.error(msg, 'Connection timed out to packages.debian.org.')
return
else:
raise
m = self._debnumpkgsre.search(html) m = self._debnumpkgsre.search(html)
if m: if m:
numberOfPackages = m.group(1) numberOfPackages = m.group(1)