diff --git a/S3/Exceptions.py b/S3/Exceptions.py index 204f3dba1..80472ef19 100644 --- a/S3/Exceptions.py +++ b/S3/Exceptions.py @@ -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 diff --git a/S3/Utils.py b/S3/Utils.py index c56d02a1d..d4b56e1f4 100644 --- a/S3/Utils.py +++ b/S3/Utils.py @@ -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) @@ -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: