Skip to content

Commit

Permalink
Remove dependency on deprecated method xml..getchildren
Browse files Browse the repository at this point in the history
  • Loading branch information
todor-ivanov committed May 14, 2024
1 parent e4628ce commit 8531ea3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/python/WMCore/Services/TagCollector/XMLUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@ def get_children(elem, event, row, key):
row for given key. The change of notations can be applied during
parsing step by using provided notations dictionary.
"""
for child in elem.getchildren():
for child in list(elem):
child_key = child.tag
child_data = child.attrib
if not child_data:
child_dict = adjust_value(child.text)
else:
child_dict = child_data

if child.getchildren(): # we got grand-children
if list(child): # we got grand-children
if child_dict:
row[key][child_key] = child_dict
else:
Expand Down

0 comments on commit 8531ea3

Please sign in to comment.