diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2018-03-10 18:53:36 +0900 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2018-03-10 18:53:36 +0900 |
commit | 10fa1b4ec2ac5205230397b63d5652d7db2bb268 (patch) | |
tree | 002ed293b4f4d78597e01580e69ad94c6cdcec70 | |
parent | 9f6ced459db670c042c6fc1a131d0ee952a86801 (diff) | |
download | buildstream-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__`.
-rw-r--r-- | buildstream/element.py | 8 |
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() |