mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
use six privided functions/classes to support py2/py3 in one source. refs #1350.
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user