summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2019-01-14 14:01:09 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2019-01-14 14:02:49 +0530
commit0d8ad9c45d45562ba9e7c7548a59c62dc1d7e59a (patch)
tree2340165cbdb1b8aae35d29d6ccf9eefb6283132b
parent23be71dadd6bd075b6702b280f42627f12d8ea93 (diff)
cerbero: Fix fallback to mirror on URLError
On Python 2, URLError is in the urllib2 module, not urllib Closes https://gitlab.freedesktop.org/gstreamer/cerbero/issues/112
-rw-r--r--cerbero/build/source.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/cerbero/build/source.py b/cerbero/build/source.py
index 6dbd390d..719ded6d 100644
--- a/cerbero/build/source.py
+++ b/cerbero/build/source.py
@@ -20,6 +20,7 @@ import os
import shutil
import tarfile
import urllib
+import urllib2
import urlparse
from cerbero.config import Platform
@@ -128,7 +129,7 @@ class Tarball (Source):
try:
shell.download(self.url, self.download_path, check_cert=cc,
overwrite=redownload)
- except (FatalError, urllib.error.URLError):
+ except (FatalError, urllib2.URLError):
# Try our mirror
shell.download(self.mirror_url, self.download_path, check_cert=cc,
overwrite=redownload)