Clean up calls to .encode() / .decode()

This commit is contained in:
Anthony Sottile 2020-01-12 10:46:33 -08:00
parent b2faf339ce
commit aefbe71765
11 changed files with 17 additions and 18 deletions

View file

@ -49,7 +49,6 @@ def _command_length(*cmd: str) -> int:
# win32 uses the amount of characters, more details at:
# https://github.com/pre-commit/pre-commit/pull/839
if sys.platform == 'win32':
# the python2.x apis require bytes, we encode as UTF-8
return len(full_cmd.encode('utf-16le')) // 2
else:
return len(full_cmd.encode(sys.getfilesystemencoding()))