summaryrefslogtreecommitdiff
path: root/buildstream/plugins/sources/_downloadablefilesource.py
diff options
context:
space:
mode:
authorJames Ennis <james.ennis@codethink.com>2018-02-28 17:22:41 +0000
committerJames Ennis <james.ennis@codethink.com>2018-03-14 14:10:26 +0000
commit0394d67d26035234553c506539b1bd790cddec1d (patch)
tree4959576b79938d26add9319773312e50b6dce67c /buildstream/plugins/sources/_downloadablefilesource.py
parent4741d1379a6e17048423f0e08588b607668ab98a (diff)
downloadbuildstream-0394d67d26035234553c506539b1bd790cddec1d.tar.gz
pylint - disabled no-member, bad-exception-context and catching-non-exception warnings
Diffstat (limited to 'buildstream/plugins/sources/_downloadablefilesource.py')
-rw-r--r--buildstream/plugins/sources/_downloadablefilesource.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/buildstream/plugins/sources/_downloadablefilesource.py b/buildstream/plugins/sources/_downloadablefilesource.py
index dba2a7356..39bd48d25 100644
--- a/buildstream/plugins/sources/_downloadablefilesource.py
+++ b/buildstream/plugins/sources/_downloadablefilesource.py
@@ -115,11 +115,13 @@ class DownloadableFileSource(Source):
return (sha256, etag)
- except (urllib.error.URLError, urllib.error.ContentTooShortError, OSError) as e:
- if isinstance(e, urllib.error.HTTPError) and e.code == 304:
- # Already cached and not modified
+ except urllib.error.HTTPError as e:
+ if e.code == 304:
return (self.ref, self.etag)
+ raise SourceError("{}: Error mirroring {}: {}"
+ .format(self, self.url, e)) from e
+ except (urllib.error.URLError, urllib.error.ContentTooShortError, OSError) as e:
raise SourceError("{}: Error mirroring {}: {}"
.format(self, self.url, e)) from e