summaryrefslogtreecommitdiff
path: root/buildstream/_plugincontext.py
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2016-11-13 21:55:54 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2016-11-13 21:55:54 +0900
commit4be7facd7f7a13a81fe5f66dc071c9a0c543698e (patch)
treebbe3fc4fb6e66de99a2d0041fc948e2786ad7597 /buildstream/_plugincontext.py
parent5c9e13d2d6560dea0b81ea4ebbdabc2972191819 (diff)
downloadbuildstream-4be7facd7f7a13a81fe5f66dc071c9a0c543698e.tar.gz
_plugincontext.py: Raise PluginError when plugin setup is not a function
Diffstat (limited to 'buildstream/_plugincontext.py')
-rw-r--r--buildstream/_plugincontext.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/buildstream/_plugincontext.py b/buildstream/_plugincontext.py
index a108c28ac..2132a9e08 100644
--- a/buildstream/_plugincontext.py
+++ b/buildstream/_plugincontext.py
@@ -81,7 +81,10 @@ class _PluginContext():
try:
plugin_type = plugin.setup()
except AttributeError as e:
- raise PluginError ("%s plugin '%s' did not provide a setup() method" %
+ raise PluginError ("%s plugin '%s' did not provide a setup() function" %
+ (self.base_type.__name__, kind)) from e
+ except TypeError as e:
+ raise PluginError ("setup symbol in %s plugin '%s' is not a function" %
(self.base_type.__name__, kind)) from e
self.assert_plugin (kind, plugin_type)