From 5ab08aaae79d813e3a16e4eae10ae2523381ee2b Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Wed, 13 Sep 2017 01:39:49 -0400 Subject: [PATCH] smooth sailing Signed-off-by: Kenneth Reitz --- pipenv/cli.py | 5 +++-- pipenv/project.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pipenv/cli.py b/pipenv/cli.py index c77ed771..695c6a0f 100644 --- a/pipenv/cli.py +++ b/pipenv/cli.py @@ -304,7 +304,7 @@ def ensure_python(three=None, python=None): if python: path_to_python = find_a_system_python(python) - if not path_to_python: + if not path_to_python and python is not None: # We need to install Python. click.echo( '{0}: Python {1} {2}'.format( @@ -604,7 +604,8 @@ def do_create_virtualenv(python=None): )) # Use virutalenv's -p python. - cmd = cmd + ['-p', python] + if python: + cmd = cmd + ['-p', python] # Actually create the virtualenv. with spinner(): diff --git a/pipenv/project.py b/pipenv/project.py index de5e6adf..e496844a 100644 --- a/pipenv/project.py +++ b/pipenv/project.py @@ -52,7 +52,7 @@ class Project(object): @property def required_python_version(self): if self.pipfile_exists: - return self.parsed_pipfile.get('requires').get('python_version') + return self.parsed_pipfile.get('requires', {}).get('python_version') @property def project_directory(self):