OpenModelica / OMSens

OpenModelica sensitivity analysis and optimization module.
12 stars 20 forks source link

'xml.etree.ElementTree.Element' object has no attribute 'getchildren' #20

Closed ElMastro closed 1 year ago

ElMastro commented 2 years ago

Running the simulation on OMEdit, OMSens crashes; the logs says:

File "/usr/share/OMSens/modelica_interface/compiled_model.py", line 132, in parameterValueInModelicaXML
    param_value_element = valueElementForParamAndXMLTree(param_name, xml_tree)
  File "/usr/share/OMSens/modelica_interface/compiled_model.py", line 121, in valueElementForParamAndXMLTree
    modelvars_element = [e for e in root.getchildren() if e.tag == "ModelVariables"][0]
AttributeError: 'xml.etree.ElementTree.Element' object has no attribute 'getchildren'

According to Stackoverflow, the method is deprecated and it seems that on this url it is suggested how to fix it.