From bfafa2294df44e89ef7b2462821e94ebce137803 Mon Sep 17 00:00:00 2001 From: Jace Browning Date: Sun, 12 Mar 2017 20:31:08 -0400 Subject: [PATCH] Fix redundant '--python' warning on Windows --- pipenv/cli.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/pipenv/cli.py b/pipenv/cli.py index 5b9fbf4b..41fbbdfd 100644 --- a/pipenv/cli.py +++ b/pipenv/cli.py @@ -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]