mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 19:19:32 +01:00
Fixed handling of timeout on socket in Debian.version.
This commit is contained in:
parent
cdda36f9fb
commit
10fe799033
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user