diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2017-06-10 13:51:53 +0200 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2017-06-10 13:51:57 +0200 |
commit | d72e6cc3069e280756c59d42406a070529ee8498 (patch) | |
tree | 86d4ea999a9ba4c5bc509cb78abde511dd9477f4 | |
parent | 7b106ff8ed5ee0295dfdb8035a3e9e8f2759cc71 (diff) |
Switch to using non-deprecated method
This uses ElementTree.iter() instead of ElementTree.getiterator() for
going over all the child elements in the tree because the latter is
deprecated.
-rw-r--r-- | pskc/xml.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pskc/xml.py b/pskc/xml.py index d5288b3..ea1e412 100644 --- a/pskc/xml.py +++ b/pskc/xml.py @@ -60,7 +60,7 @@ def parse(source): def remove_namespaces(tree): """Remove namespaces from all elements in the tree.""" import re - for elem in tree.getiterator(): + for elem in tree.iter(): if isinstance(elem.tag, ''.__class__): # pragma: no branch elem.tag = re.sub(r'^\{[^}]*\}', '', elem.tag) |