From d72e6cc3069e280756c59d42406a070529ee8498 Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Sat, 10 Jun 2017 13:51:53 +0200 Subject: 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. --- pskc/xml.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- cgit v1.2.3