From: Neil Muller Date: Sun, 13 May 2018 15:09:55 +0200 Subject: Only HTTPError has a code attribute This would cause irker to crash in case we get a URLError instead of HTTPError, for example. Patch-Name: 0010-fix_ioerror_exception.patch Forwarded: https://gitlab.com/esr/irker/merge_requests/14 --- irkerhook.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/irkerhook.py b/irkerhook.py index 8bf46f8..d32b742 100755 --- a/irkerhook.py +++ b/irkerhook.py @@ -95,12 +95,14 @@ class Commit: self.url = webview else: self.url = webview - except IOError as e: + except urllib2.HTTPError as e: if e.code == 401: # Authentication error, so we assume the view is valid self.url = webview else: self.url = "" + except IOError: + self.url = "" res = self.template % self.__dict__ return unicode(res, 'UTF-8') if not isinstance(res, unicode) else res