Skip to content

Commit

Permalink
Replace x.getchildren with list(x) (Fix ome#281)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshmoore committed Mar 19, 2021
1 parent 5d039b3 commit 1c36b7b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/omero/plugins/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -1155,7 +1155,7 @@ def clear_tail(elem):
elem.tail = ""
if elem.text is not None and not elem.text.strip():
elem.text = ""
for child in elem.getchildren():
for child in list(elem):
clear_tail(child)

clear_tail(template_xml)
Expand Down
6 changes: 3 additions & 3 deletions test/unit/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ def assertXml(elementA, elementB):
for k in B_attr:
assert A_attr[k] == B_attr[k], cf(elementA, elementB)

A_kids = dict([pair(x) for x in elementA.getchildren()])
B_kids = dict([pair(x) for x in elementB.getchildren()])
A_kids = dict([pair(x) for x in list(elementA)])
B_kids = dict([pair(x) for x in list(elementB)])
for k in A_attr:
assertXml(A_kids[k], B_kids[k])
for k in B_attr:
Expand Down Expand Up @@ -127,7 +127,7 @@ def get_profile_name(p):
for x in props:
id = x.attrib["id"]
if id == "__ACTIVE__":
for y in x.getchildren():
for y in list(x):
if y.attrib["name"] == "omero.config.profile":
return y.attrib["value"]

Expand Down

0 comments on commit 1c36b7b

Please sign in to comment.