use six privided functions/classes to support py2/py3 in one source. refs #1350.

This commit is contained in:
Takayuki Shimizukawa
2014-04-29 19:59:58 +09:00
parent 68290a266c
commit c3c879f2c6
24 changed files with 79 additions and 80 deletions

View File

@@ -81,6 +81,9 @@
from __future__ import generators
from __future__ import absolute_import
import six
__all__ = [
# public symbols
"Comment",
@@ -828,7 +831,7 @@ def _namespaces(elem, encoding, default_namespace=None):
tag = elem.tag
if isinstance(tag, QName) and tag.text not in qnames:
add_qname(tag.text)
elif isinstance(tag, basestring):
elif isinstance(tag, six.string_types):
if tag not in qnames:
add_qname(tag)
elif tag is not None and tag is not Comment and tag is not PI: