summaryrefslogtreecommitdiff
path: root/Lib/xml/etree/ElementTree.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/xml/etree/ElementTree.py')
-rw-r--r--Lib/xml/etree/ElementTree.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/xml/etree/ElementTree.py b/Lib/xml/etree/ElementTree.py
index 181a461d77..d89fd3be0c 100644
--- a/Lib/xml/etree/ElementTree.py
+++ b/Lib/xml/etree/ElementTree.py
@@ -871,8 +871,9 @@ def _namespaces(elem, encoding, default_namespace=None):
iterate = elem.getiterator # cET compatibility
for elem in iterate():
tag = elem.tag
- if isinstance(tag, QName) and tag.text not in qnames:
- add_qname(tag.text)
+ if isinstance(tag, QName):
+ if tag.text not in qnames:
+ add_qname(tag.text)
elif isinstance(tag, basestring):
if tag not in qnames:
add_qname(tag)