Use basestring instead of str
This commit is contained in:
parent
5598d1de5a
commit
d06ecc6b25
@ -330,8 +330,9 @@ class T2CharString(ByteCodeBase):
|
|||||||
self.bytecode = bytecode
|
self.bytecode = bytecode
|
||||||
self.program = None
|
self.program = None
|
||||||
|
|
||||||
def getToken(self, index,
|
def getToken(self, index,
|
||||||
len=len, byteord=byteord, getattr=getattr, type=type, StringType=str):
|
len=len, byteord=byteord, basestring=basestring,
|
||||||
|
isinstance=isinstance):
|
||||||
if self.bytecode is not None:
|
if self.bytecode is not None:
|
||||||
if index >= len(self.bytecode):
|
if index >= len(self.bytecode):
|
||||||
return None, 0, 0
|
return None, 0, 0
|
||||||
@ -344,7 +345,7 @@ class T2CharString(ByteCodeBase):
|
|||||||
return None, 0, 0
|
return None, 0, 0
|
||||||
token = self.program[index]
|
token = self.program[index]
|
||||||
index = index + 1
|
index = index + 1
|
||||||
isOperator = isinstance(token, StringType)
|
isOperator = isinstance(token, basestring)
|
||||||
return token, isOperator, index
|
return token, isOperator, index
|
||||||
|
|
||||||
def getBytes(self, index, nBytes):
|
def getBytes(self, index, nBytes):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user