scripts: twister: Fix error in dt_label_with_parent_compat_enabled
In dt_label_with_parent_compat_enabled, it maybe that there is no node matching expected label. In this case don't generate error, but return False. Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
This commit is contained in:
parent
be2e6a0850
commit
e5bf24b325
1 changed files with 4 additions and 1 deletions
|
@ -268,7 +268,10 @@ def ast_expr(ast, env, edt):
|
||||||
compat = ast[1][1]
|
compat = ast[1][1]
|
||||||
label = ast[1][0]
|
label = ast[1][0]
|
||||||
node = edt.label2node.get(label)
|
node = edt.label2node.get(label)
|
||||||
parent = node.parent
|
if node is not None:
|
||||||
|
parent = node.parent
|
||||||
|
else:
|
||||||
|
return False
|
||||||
return parent is not None and parent.status == 'okay' and parent.matching_compat == compat
|
return parent is not None and parent.status == 'okay' and parent.matching_compat == compat
|
||||||
elif ast[0] == "dt_chosen_enabled":
|
elif ast[0] == "dt_chosen_enabled":
|
||||||
chosen = ast[1][0]
|
chosen = ast[1][0]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue