shlex.join is always available in 3.8+

This commit is contained in:
Anthony Sottile 2023-07-01 17:22:42 -04:00
parent 3126802bf4
commit 1c439b5a79

View file

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