mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
Merge pull request #164 from nateprewitt/python_precedence
use specified python version over --three/--two
This commit is contained in:
+5
-3
@@ -85,7 +85,7 @@ def ensure_virtualenv(three=None, python=None):
|
||||
if not project.virtualenv_exists:
|
||||
do_create_virtualenv(three=three, python=python)
|
||||
|
||||
# If --three / --two were passed...
|
||||
# If --three, --two, or --python were passed...
|
||||
elif (python) or (three is not None):
|
||||
click.echo(crayons.red('Virtualenv already exists!'), err=True)
|
||||
click.echo(crayons.yellow('Removing existing virtualenv...'), err=True)
|
||||
@@ -301,9 +301,11 @@ def do_create_virtualenv(three=None, python=None):
|
||||
cmd = ['virtualenv', project.virtualenv_location, '--prompt=({0})'.format(project.name)]
|
||||
|
||||
# Pass a Python version to virtualenv, if needed.
|
||||
if three is False:
|
||||
if python:
|
||||
click.echo(crayons.yellow('Using {0} to create virtualenv...'.format(python)))
|
||||
elif three is False:
|
||||
python = 'python2'
|
||||
if three is True:
|
||||
elif three is True:
|
||||
python = 'python3'
|
||||
|
||||
if python:
|
||||
|
||||
Reference in New Issue
Block a user