Skip to content

Commit

Permalink
Merge pull request #1137 from ondrejbudai/python39-fixes
Browse files Browse the repository at this point in the history
fix compatibility with Python 3.9
  • Loading branch information
fviard authored Oct 12, 2020
2 parents 639edbe + 328ced8 commit b409c1d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion S3/Exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def parse_error_xml(tree):
if not error_node.tag == "Error":
error_node = tree.find(".//Error")
if error_node is not None:
for child in error_node.getchildren():
for child in error_node:
if child.text != "":
debug("ErrorXML: " + child.tag + ": " + repr(child.text))
info[child.tag] = child.text
Expand Down
8 changes: 4 additions & 4 deletions S3/Utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ def parseNodes(nodes):
retval = []
for node in nodes:
retval_item = {}
for child in node.getchildren():
for child in node:
name = decode_from_s3(child.tag)
if child.getchildren():
if len(child):
retval_item[name] = parseNodes([child])
else:
found_text = node.findtext(".//%s" % child.tag)
Expand Down Expand Up @@ -124,8 +124,8 @@ def getListFromXml(xml, node):

def getDictFromTree(tree):
ret_dict = {}
for child in tree.getchildren():
if child.getchildren():
for child in tree:
if len(child):
## Complex-type child. Recurse
content = getDictFromTree(child)
else:
Expand Down

0 comments on commit b409c1d

Please sign in to comment.