Merge pull request #1708 from madig/name-toStr-equal-toUnicode

name: Remove now unnecessary Python 2 code path
This commit is contained in:
Cosimo Lupo 2019-09-10 16:22:54 +02:00 committed by GitHub
commit 4e9fa7a44c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -390,13 +390,7 @@ class NameRecord(object):
"""
return tobytes(self.string, encoding=self.getEncoding(), errors=errors)
def toStr(self, errors='strict'):
if str == bytes:
# python 2
return self.toBytes(errors)
else:
# python 3
return self.toUnicode(errors)
toStr = toUnicode
def toXML(self, writer, ttFont):
try: