mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-23 19:22:45 +01:00
utils.str: Prevent issue with tokens like '\x80' in Python 3.
This commit is contained in:
parent
b421120bad
commit
2ace534bdb
@ -307,7 +307,10 @@ class Tokenizer(object):
|
||||
else:
|
||||
token = codecs.getencoder('utf8')(token)[0]
|
||||
token = codecs.getdecoder('unicode_escape')(token)[0]
|
||||
token = token.encode('iso-8859-1').decode()
|
||||
try:
|
||||
token = token.encode('iso-8859-1').decode()
|
||||
except: # Prevent issue with tokens like '"\\x80"'.
|
||||
pass
|
||||
return token
|
||||
|
||||
def _insideBrackets(self, lexer):
|
||||
|
Loading…
Reference in New Issue
Block a user