Merge pull request #1626 from uranusjr/fix-no-python-in-path

Avoid type error when there’s no Python in PATH
This commit is contained in:
2018-03-09 01:44:22 -05:00
committed by GitHub
+3 -3
View File
@@ -625,9 +625,9 @@ def ensure_project(three=None, python=None, validate=True, system=False, warn=Tr
# Warn users if they are using the wrong version of Python.
if project.required_python_version:
path_to_python = which('python')
path_to_python = which('python') or which('py')
if project.required_python_version not in (python_version(path_to_python) or ''):
if path_to_python and project.required_python_version not in (python_version(path_to_python) or ''):
click.echo(
'{0}: Your Pipfile requires {1} {2}, '
'but you are using {3} ({4}).'.format(
@@ -1767,7 +1767,7 @@ def do_install(
except IOError:
click.echo(
crayons.red(
u'Unable to find requirements file at {0}.'.format(crayons.normal(requirements))
u'Unable to find requirements file at {0}.'.format(crayons.normal(requirements))
),
err=True
)