diff options
Diffstat (limited to 'Lib/fontTools/misc/etree.py')
-rw-r--r-- | Lib/fontTools/misc/etree.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/fontTools/misc/etree.py b/Lib/fontTools/misc/etree.py index 2338f099..6e943e4b 100644 --- a/Lib/fontTools/misc/etree.py +++ b/Lib/fontTools/misc/etree.py @@ -11,7 +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 fontTools.misc.py23 import basestring, unicode, tounicode, open +from fontTools.misc.py23 import unicode, tostr XML_DECLARATION = """<?xml version='1.0' encoding='%s'?>""" @@ -242,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. " @@ -356,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: |