diff options
Diffstat (limited to 'Lib/fontTools/misc/etree.py')
-rw-r--r-- | Lib/fontTools/misc/etree.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/fontTools/misc/etree.py b/Lib/fontTools/misc/etree.py index 08e43f0a..6e943e4b 100644 --- a/Lib/fontTools/misc/etree.py +++ b/Lib/fontTools/misc/etree.py @@ -11,8 +11,7 @@ or subclasses built-in ElementTree classes to add features that are only availble in lxml, like OrderedDict for attributes, pretty_print and iterwalk. """ -from __future__ import absolute_import, unicode_literals -from fontTools.misc.py23 import basestring, unicode, tounicode, open +from fontTools.misc.py23 import unicode, tostr XML_DECLARATION = """<?xml version='1.0' encoding='%s'?>""" @@ -243,7 +242,7 @@ except ImportError: Reject all bytes input that contains non-ASCII characters. """ try: - s = tounicode(s, encoding="ascii", errors="strict") + s = tostr(s, encoding="ascii", errors="strict") except UnicodeDecodeError: raise ValueError( "Bytes strings can only contain ASCII characters. " @@ -357,7 +356,7 @@ except ImportError: if isinstance(tag, QName): if tag.text not in qnames: add_qname(tag.text) - elif isinstance(tag, basestring): + elif isinstance(tag, str): if tag not in qnames: add_qname(tag) elif tag is not None and tag is not Comment and tag is not PI: |