Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix compatibility with Python 3.9 #1137

Merged
merged 1 commit into from
Oct 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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