mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Use sys.executable when executing virtualenv. Resolves #208.
This commit is contained in:
parent
c4ff9d4988
commit
fbf86c775c
1 changed files with 5 additions and 1 deletions
|
|
@ -3,6 +3,7 @@ from __future__ import unicode_literals
|
|||
import contextlib
|
||||
import distutils.spawn
|
||||
import os
|
||||
import sys
|
||||
|
||||
import virtualenv
|
||||
|
||||
|
|
@ -43,7 +44,10 @@ def install_environment(repo_cmd_runner, version='default'):
|
|||
|
||||
# Install a virtualenv
|
||||
with clean_path_on_failure(repo_cmd_runner.path(ENVIRONMENT_DIR)):
|
||||
venv_cmd = ['virtualenv', '{{prefix}}{0}'.format(ENVIRONMENT_DIR)]
|
||||
venv_cmd = [
|
||||
sys.executable, '-m', 'virtualenv',
|
||||
'{{prefix}}{0}'.format(ENVIRONMENT_DIR)
|
||||
]
|
||||
if version != 'default':
|
||||
venv_cmd.extend(['-p', norm_version(version)])
|
||||
repo_cmd_runner.run(venv_cmd)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue