mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 05:35:49 -04:00
handle xml parsing errors better
This commit is contained in:
parent
9060d420fa
commit
f9715ff0cf
1 changed files with 6 additions and 1 deletions
|
|
@ -57,7 +57,12 @@ for xml_file in xml_files:
|
|||
print(text + '.'*(30 - len(text)), end="")
|
||||
|
||||
# Validate the XML file
|
||||
xml_tree = etree.parse(xml_file)
|
||||
try:
|
||||
xml_tree = etree.parse(xml_file)
|
||||
except etree.XMLSyntaxError as e:
|
||||
print(BOLD + FAIL + '[XML ERROR]' + ENDC)
|
||||
print(" {0}".format(e))
|
||||
continue
|
||||
|
||||
# Get xml_filename prefix
|
||||
xml_prefix = os.path.basename(xml_file)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue