PYTHON: Process version only if explicitely present in XML files.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
This commit is contained in:
parent
5cd0353b37
commit
a8ea128d6a
@ -50,7 +50,8 @@ class AmunXML(Amun):
|
||||
tree = ET.parse(mfile)
|
||||
root = tree.getroot()
|
||||
if self.version < 0:
|
||||
self.version = int(float(root.attrib['version']))
|
||||
if 'version' in root.attrib:
|
||||
self.version = int(float(root.attrib['version']))
|
||||
if root.tag == 'AMUNFile':
|
||||
self.dataformat = 'AmunXML'
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user