Merge branch 'master' of github.com:antlr/antlr4 into master

This commit is contained in:
parrt 2020-11-26 10:54:35 -08:00
commit 74aad515dc
1 changed files with 2 additions and 2 deletions

View File

@ -15,9 +15,9 @@ import sys
class InputStream (object): class InputStream (object):
def __init__(self, data): def __init__(self, data, encoding = "ascii"):
self.name = "<empty>" self.name = "<empty>"
self.strdata = unicode(data) self.strdata = data if isinstance(data, unicode) else unicode(data, encoding)
self._loadString() self._loadString()
def _loadString(self): def _loadString(self):