mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-20 01:19:26 +01:00
src/callbacks.py: Use unicode_escape if running Python 3.
This commit is contained in:
parent
34bb33b65f
commit
0e450a5eff
@ -284,7 +284,8 @@ class Tokenizer(object):
|
|||||||
def _handleToken(self, token):
|
def _handleToken(self, token):
|
||||||
if token[0] == token[-1] and token[0] in self.quotes:
|
if token[0] == token[-1] and token[0] in self.quotes:
|
||||||
token = token[1:-1]
|
token = token[1:-1]
|
||||||
token = token.encode().decode('string_escape')
|
encoding_prefix = 'string' if sys.version_info[0]<3 else 'unicode'
|
||||||
|
token = token.encode().decode(encoding_prefix + '_escape')
|
||||||
return token
|
return token
|
||||||
|
|
||||||
def _insideBrackets(self, lexer):
|
def _insideBrackets(self, lexer):
|
||||||
|
Loading…
Reference in New Issue
Block a user