diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2018-04-19 15:38:09 +0900 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2018-04-19 15:38:09 +0900 |
commit | f5b99559ef7df91fe11f6b97be66c96b81911152 (patch) | |
tree | a13969542dc5b577646b18d11da3d4293001566a | |
parent | a8c31ff3729e96529ee71c80dcbe44f5ff56b590 (diff) | |
download | buildstream-f5b99559ef7df91fe11f6b97be66c96b81911152.tar.gz |
buildstream/plugin.py: Fixing unused variables
-rw-r--r-- | buildstream/plugin.py | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/buildstream/plugin.py b/buildstream/plugin.py index 06c903191..b208e2d06 100644 --- a/buildstream/plugin.py +++ b/buildstream/plugin.py @@ -695,13 +695,8 @@ __PLUGINS_TABLE = WeakValueDictionary() # (Plugin): The plugin for the given ID, or None # def _plugin_lookup(unique_id): - try: - plugin = __PLUGINS_TABLE[unique_id] - except (AttributeError, KeyError) as e: - print("Could not find plugin with ID {}".format(unique_id)) - raise - - return plugin + assert unique_id in __PLUGINS_TABLE, "Could not find plugin with ID {}".format(unique_id) + return __PLUGINS_TABLE[unique_id] # No need for unregister, WeakValueDictionary() will remove entries |