Skip to content

Commit 36f5b56

Browse files
committed
Check presence of initlist, commands and command tags and act accordingly.
1 parent a98aff3 commit 36f5b56

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/hal/drivers/mesa-hostmot2/mesambccc.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1510,6 +1510,16 @@ def main():
15101510
else:
15111511
perr("Invalid/unknown tag '{}'".format(node.tag))
15121512

1513+
# If no <initlist> tag is present, create an empty one
1514+
if None == initlist:
1515+
initlist = []
1516+
1517+
# It is an error if no <commands> tag is present or the list is empty
1518+
if None == commands:
1519+
perr("Missing <commands> tag")
1520+
elif len(commands) < 1:
1521+
perr("No <command> tags defined in <commands>")
1522+
15131523
# Quit if a parse error occurred
15141524
if errorflag:
15151525
return 1

0 commit comments

Comments
 (0)