fix failing Python2 tests with utf-8 encoding

This commit is contained in:
Eric Vergnaud 2020-10-11 15:48:11 +08:00
parent fa0c0b665e
commit 9a288bcb25
1 changed files with 1 additions and 1 deletions

View File

@ -17,7 +17,7 @@ class InputStream (object):
def __init__(self, data, encoding = "ascii"):
self.name = "<empty>"
self.strdata = unicode(data, encoding) if encoding != "utf-8" else data
self.strdata = data if isinstance(data, unicode) else unicode(data, encoding)
self._loadString()
def _loadString(self):