aboutsummaryrefslogtreecommitdiff
path: root/modules/github.py
diff options
context:
space:
mode:
authorGravatar jesopo2018-12-14 08:49:37 +0000
committerGravatar jesopo2018-12-14 08:49:37 +0000
commit1ffc7863a060a585ec29b36109ba71af772c9263 (patch)
tree92edc4632f8bdd04883dc0bc32d4031cedb0875b /modules/github.py
parentFix missing change to new Response objects from utils.http.request (youtube.py) (diff)
signature
If a request to git.io times out, fall back to full url
Diffstat (limited to 'modules/github.py')
-rw-r--r--modules/github.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/modules/github.py b/modules/github.py
index c26f7863..6e17e41a 100644
--- a/modules/github.py
+++ b/modules/github.py
@@ -105,9 +105,12 @@ class Module(ModuleManager.BaseModule):
return ""
def _short_url(self, url):
- page = utils.http.request("https://git.io", method="POST",
- post_data={"url": url})
- return page.headers["Location"]
+ try:
+ page = utils.http.request("https://git.io", method="POST",
+ post_data={"url": url})
+ return page.headers["Location"]
+ except utils.http.HTTPTimeoutException:
+ return url
def _change_count(self, n, symbol, color):
return utils.irc.color("%s%d" % (symbol, n), color)+utils.irc.bold("")