filter-repo (python3): oct strings in python3 use "0o" instead of "0"

Signed-off-by: Elijah Newren <newren@gmail.com>
This commit is contained in:
Elijah Newren 2019-04-27 14:16:31 -07:00
parent c3072c7f01
commit ca5818056d

View File

@ -157,7 +157,7 @@ class PathQuoting:
'"': '"',
'\\':'\\'}
_unescape_re = re.compile(r'\\([a-z"\\]|[0-9]{3})')
_escape = [chr(x) for x in range(127)]+['\\'+oct(x)[1:] for x in range(127,256)]
_escape = [chr(x) for x in range(127)]+['\\'+oct(x)[2:] for x in range(127,256)]
_reverse = dict(map(reversed, _unescape.items()))
for x in _reverse:
_escape[ord(x)] = '\\'+_reverse[x]