Skip to content

Commit

Permalink
Fix error with python 3.9
Browse files Browse the repository at this point in the history
AttributeError: 'xml.etree.ElementTree.Element' object has no attribute 'getchildren'
getchildren() has been removed in python 3.9

Signed-off-by: Etienne Champetier <echampetier@anevia.com>
  • Loading branch information
champtar authored and seveas committed Nov 19, 2020
1 parent 17d7d78 commit 86fbe99
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hpilo.py
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ def _element_to_dict(self, element):
retval[key.lower()] = self._coerce(val)
if list(element):
fields = []
for child in element.getchildren():
for child in element:
if child.tag == 'FIELD':
fields.append(self._element_to_dict(child))
if fields:
Expand Down

0 comments on commit 86fbe99

Please sign in to comment.