summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin David <valentin.david@codethink.co.uk>2018-06-28 15:35:30 +0200
committerValentin David <valentin.david@codethink.co.uk>2018-07-02 16:25:58 +0200
commit7eccd568b857954231697d1f82713c3f7a5f95dd (patch)
treeaf138686cdaacc5fd2a657ae0d76055f501f81ae
parent37b1a77c0fb0c575555956862eeb20caf94fe289 (diff)
downloadbuildstream-7eccd568b857954231697d1f82713c3f7a5f95dd.tar.gz
buildstream/element.py: Convert an exception to an assert.
This situation should not happen.
-rw-r--r--buildstream/element.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/buildstream/element.py b/buildstream/element.py
index 30665e35f..736589491 100644
--- a/buildstream/element.py
+++ b/buildstream/element.py
@@ -2112,12 +2112,9 @@ class Element(Plugin):
if self.__is_junction:
splits = _yaml.node_chain_copy(element_splits)
- elif project._splits is None:
- raise LoadError(LoadErrorReason.INVALID_DATA,
- "{}: Project was not fully loaded while loading element. "
- "Only non-artifact elements (e.g. junctions) are allowed in this context."
- .format(self.name))
else:
+ assert project._splits is not None
+
splits = _yaml.node_chain_copy(project._splits)
# Extend project wide split rules with any split rules defined by the element
_yaml.composite(splits, element_splits)