summaryrefslogtreecommitdiff
path: root/buildstream
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-03-10 18:53:36 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-03-10 18:53:36 +0900
commit10fa1b4ec2ac5205230397b63d5652d7db2bb268 (patch)
tree002ed293b4f4d78597e01580e69ad94c6cdcec70 /buildstream
parent9f6ced459db670c042c6fc1a131d0ee952a86801 (diff)
downloadbuildstream-10fa1b4ec2ac5205230397b63d5652d7db2bb268.tar.gz
element.py: Report errors using `self.get_kind()`
We should always show the user the "kind" string when referring to a plugin type, not the type name with `type(self).__name__`.
Diffstat (limited to 'buildstream')
-rw-r--r--buildstream/element.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/buildstream/element.py b/buildstream/element.py
index 394439e37..2b2f16062 100644
--- a/buildstream/element.py
+++ b/buildstream/element.py
@@ -1676,14 +1676,14 @@ class Element(Plugin):
if self.BST_FORBID_RDEPENDS:
runtime_deps = list(self.dependencies(Scope.RUN, recurse=False))
if runtime_deps:
- raise ElementError("{}: Runtime dependencies are forbidden for elements of type {}"
- .format(self, type(self).__name__), reason="element-forbidden-rdepends")
+ raise ElementError("{}: Runtime dependencies are forbidden for '{}' elements"
+ .format(self, self.get_kind()), reason="element-forbidden-rdepends")
if self.BST_FORBID_SOURCES:
sources = list(self.sources())
if sources:
- raise ElementError("{}: Sources are forbidden for elements of type {}"
- .format(self, type(self).__name__), reason="element-forbidden-sources")
+ raise ElementError("{}: Sources are forbidden for '{}' elements"
+ .format(self, self.get_kind()), reason="element-forbidden-sources")
self.preflight()