summaryrefslogtreecommitdiffstats
path: root/debian/patches/0010-fix_ioerror_exception.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/0010-fix_ioerror_exception.patch')
-rw-r--r--debian/patches/0010-fix_ioerror_exception.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/debian/patches/0010-fix_ioerror_exception.patch b/debian/patches/0010-fix_ioerror_exception.patch
new file mode 100644
index 0000000..f9bfcee
--- /dev/null
+++ b/debian/patches/0010-fix_ioerror_exception.patch
@@ -0,0 +1,33 @@
+From: Neil Muller <drnlmuller+debian@gmail.com>
+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
+