You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by gi...@apache.org on 2020/12/29 13:14:05 UTC

[buildstream] 20/30: buildstream/element.py: Convert an exception to an assert.

This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a commit to branch valentindavid/flatpak-demo
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit 7eccd568b857954231697d1f82713c3f7a5f95dd
Author: Valentin David <va...@codethink.co.uk>
AuthorDate: Thu Jun 28 15:35:30 2018 +0200

    buildstream/element.py: Convert an exception to an assert.
    
    This situation should not happen.
---
 buildstream/element.py | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/buildstream/element.py b/buildstream/element.py
index 30665e3..7365894 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)