Skip to content

Commit

Permalink
Python 2 to Python 3 - modules/tools.py
Browse files Browse the repository at this point in the history
about encoding stuff for path to files
  • Loading branch information
SimonSAMPERE committed Jun 17, 2019
1 parent bfac0a4 commit 0aa5121
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/tools.py
Expand Up @@ -388,12 +388,12 @@ def _to_raw_string(self, in_string):
:param str in_string: string (str or unicode) to convert to raw
"""
if isinstance(in_string, str):
logger.debug(in_string)
return in_string.encode('string-escape')
elif isinstance(in_string, unicode):
if isinstance(in_string, str) or isinstance(in_string, unicode):
logger.debug(in_string)
return in_string.encode('unicode-escape')
# elif isinstance(in_string, unicode):
# logger.debug(in_string)
# return in_string.encode('unicode-escape')
else:
raise TypeError

Expand Down

0 comments on commit 0aa5121

Please sign in to comment.