Use pipes.quote for executable path

This commit is contained in:
Anthony Sottile
2017-09-21 15:16:48 -07:00
parent 6b81fe9d58
commit 873dd173ce
3 changed files with 6 additions and 4 deletions

View File

@@ -3,6 +3,7 @@ from __future__ import unicode_literals
import io
import os.path
import pipes
import sys
from pre_commit import output
@@ -68,7 +69,7 @@ def install(
skip_on_missing_conf = 'true' if skip_on_missing_conf else 'false'
contents = io.open(resource_filename('hook-tmpl')).read().format(
sys_executable=sys.executable,
sys_executable=pipes.quote(sys.executable),
hook_type=hook_type,
hook_specific=hook_specific_contents,
config_file=runner.config_file,