From 9d44399ed5e0f35bdffa0b42954794153d2b2ab1 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Tue, 18 Nov 2003 10:49:15 +0000 Subject: [PATCH] Fixed an uncaught exception in Debian.version. --- plugins/Debian.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/plugins/Debian.py b/plugins/Debian.py index 4770dd8f8..9f2d3b45d 100644 --- a/plugins/Debian.py +++ b/plugins/Debian.py @@ -193,9 +193,13 @@ class Debian(callbacks.Privmsg, plugins.PeriodicFileDownloader): package = urllib.quote(package) url = 'http://packages.debian.org/cgi-bin/search_packages.pl?keywords'\ '=%s&searchon=names&version=%s&release=all' % (package, branch) - fd = urllib2.urlopen(url) - html = fd.read() - fd.close() + try: + fd = urllib2.urlopen(url) + html = fd.read() + fd.close() + except urllib2.HTTPError, e: + irc.error(msg, 'I couldn\'t reach the search page (%s).' % e) + return m = self._debnumpkgsre.search(html) if m: numberOfPackages = m.group(1)