Merge pull request #268 from jacebrowning/fix-python-warning-on-windows

Fix redundant '--python' warning on Windows
This commit is contained in:
Nate Prewitt
2017-03-12 18:35:19 -06:00
committed by GitHub
+7 -9
View File
@@ -344,15 +344,13 @@ def do_create_virtualenv(three=None, python=None):
# Pass a Python version to virtualenv, if needed.
if python:
click.echo('{0} {1} {2}'.format(crayons.yellow('Using'), crayons.red(python), crayons.yellow('to create virtualenv...')))
elif three is False:
python = 'python2'
elif three is True:
python = 'python3'
# Windows!
if os.name == 'nt':
click.echo('{0} If you are running on Windows, you should use the {1} option instead.'.format(crayons.red('Warning!'), crayons.green('--python')))
else:
if os.name == 'nt':
click.echo('{0} If you are running on Windows, you should use the {1} option instead.'.format(crayons.red('Warning!'), crayons.green('--python')))
if three is False:
python = 'python2'
elif three is True:
python = 'python3'
if python:
cmd = cmd + ['-p', python]