summaryrefslogtreecommitdiff
path: root/buildstream
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
parent4741d1379a6e17048423f0e08588b607668ab98a (diff)
downloadbuildstream-0394d67d26035234553c506539b1bd790cddec1d.tar.gz
pylint - disabled no-member, bad-exception-context and catching-non-exception warnings
Diffstat (limited to 'buildstream')
-rw-r--r--buildstream/_ostree.py4
-rw-r--r--buildstream/plugins/elements/filter.py6
-rw-r--r--buildstream/plugins/sources/_downloadablefilesource.py8
3 files changed, 13 insertions, 5 deletions
diff --git a/buildstream/_ostree.py b/buildstream/_ostree.py
index 9a9e44998..7d0d687a3 100644
--- a/buildstream/_ostree.py
+++ b/buildstream/_ostree.py
@@ -22,6 +22,10 @@
#
# Code based on Jürg's artifact cache and Andrew's ostree plugin
#
+
+# Disable pylint warnings that are not appicable to this module
+# pylint: disable=bad-exception-context,catching-non-exception
+
import os
from ._exceptions import BstError, ErrorDomain
diff --git a/buildstream/plugins/elements/filter.py b/buildstream/plugins/elements/filter.py
index b6d82e1f3..672b801ce 100644
--- a/buildstream/plugins/elements/filter.py
+++ b/buildstream/plugins/elements/filter.py
@@ -64,7 +64,8 @@ class FilterElement(Element):
build_deps = list(self.dependencies(Scope.BUILD, recurse=False))
if len(build_deps) != 1:
detail = "Full list of build-depends:\n"
- detail += " \n".join([x.name for x in build_deps])
+ deps_list = " \n".join([x.name for x in build_deps])
+ detail += deps_list
raise ElementError("{}: {} element must have exactly 1 build-dependency, actually have {}"
.format(self, type(self).__name__, len(build_deps)),
detail=detail, reason="filter-bdepend-wrong-count")
@@ -73,7 +74,8 @@ class FilterElement(Element):
runtime_deps = list(self.dependencies(Scope.RUN, recurse=False))
if build_deps[0] in runtime_deps:
detail = "Full list of runtime depends:\n"
- detail += " \n".join([x.name for x in runtime_deps])
+ deps_list = " \n".join([x.name for x in runtime_deps])
+ detail += deps_list
raise ElementError("{}: {} element's build dependency must not also be a runtime dependency"
.format(self, type(self).__name__),
detail=detail, reason="filter-bdepend-also-rdepend")
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