Merge pull request #2917 from pre-commit/py38-shelx-join

shlex.join is always available in 3.8+
This commit is contained in:
Anthony Sottile 2023-07-01 17:33:28 -04:00 committed by GitHub
commit 8bf22bd3c1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -103,8 +103,7 @@ def _install_hook_script(
hook_file.write(before + TEMPLATE_START)
hook_file.write(f'INSTALL_PYTHON={shlex.quote(sys.executable)}\n')
# TODO: python3.8+: shlex.join
args_s = ' '.join(shlex.quote(part) for part in args)
args_s = shlex.join(args)
hook_file.write(f'ARGS=({args_s})\n')
hook_file.write(TEMPLATE_END + after)
make_executable(hook_path)