Fixed more python 2/3 unicode issues.

This commit is contained in:
Markus Lampert
2017-10-22 19:50:30 -07:00
parent dce9c0e385
commit 7448d47b8a
2 changed files with 25 additions and 18 deletions

View File

@@ -100,7 +100,7 @@ Use this function to remove all expressions before deletion.'''
def toUnicode(string):
'''toUnicode(string) ... returns a unicode version of string regardless of the python version.'''
if sys.version_info[0] < 3:
if sys.version_info.major < 3:
return unicode(string)
return string
@@ -108,7 +108,7 @@ def isString(string):
'''isString(string) ... return True if string is a string, regardless of string type and python version.'''
if type(string) == str:
return True
if sys.version_info[0] < 3 and type(string) == unicode:
if sys.version_info.major < 3 and type(string) == unicode:
return True
return False