diff --git a/OMPython/__init__.py b/OMPython/__init__.py index 7cde7d3a6..7aa07fa13 100644 --- a/OMPython/__init__.py +++ b/OMPython/__init__.py @@ -620,7 +620,6 @@ def __init__(self, fileName=None, modelName=None, lmodel=None, commandLineOption if fileName is None and modelName is None and not lmodel: # all None raise Exception("Cannot create ModelicaSystem object without any arguments") - self.tree = None self.quantitiesList = [] self.paramlist = {} self.inputlist = {} @@ -842,9 +841,8 @@ def xmlparse(self): self._raise_error(errstr=f"XML file not generated: {self.xmlFile}") return - self.tree = ET.parse(self.xmlFile) - self.root = self.tree.getroot() - rootCQ = self.root + tree = ET.parse(self.xmlFile) + rootCQ = tree.getroot() for attr in rootCQ.iter('DefaultExperiment'): for key in ("startTime", "stopTime", "stepSize", "tolerance", "solver", "outputFormat"):