aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Bachelier <laurent@bachelier.name>2016-09-12 17:39:15 +0200
committerLaurent Bachelier <laurent@bachelier.name>2016-09-12 17:55:25 +0200
commit7b5019b8bdba49e24ca1cbc8b81f665e19f50ce1 (patch)
treeae8902c90983080b1ccf4468ec74aa77169b2259
parentNeed to incrememt version in the right file. (diff)
downloadirker-7b5019b8bdba49e24ca1cbc8b81f665e19f50ce1.tar.xz
Only HTTPError has a code attribute
-rwxr-xr-xirkerhook.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/irkerhook.py b/irkerhook.py
index 9768eac..ce19446 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