mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +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:
|
else:
|
||||||
token = codecs.getencoder('utf8')(token)[0]
|
token = codecs.getencoder('utf8')(token)[0]
|
||||||
token = codecs.getdecoder('unicode_escape')(token)[0]
|
token = codecs.getdecoder('unicode_escape')(token)[0]
|
||||||
|
try:
|
||||||
token = token.encode('iso-8859-1').decode()
|
token = token.encode('iso-8859-1').decode()
|
||||||
|
except: # Prevent issue with tokens like '"\\x80"'.
|
||||||
|
pass
|
||||||
return token
|
return token
|
||||||
|
|
||||||
def _insideBrackets(self, lexer):
|
def _insideBrackets(self, lexer):
|
||||||
|
Loading…
Reference in New Issue
Block a user