From bef684dc0315f46bfa0abb27e9a9349d266b851f Mon Sep 17 00:00:00 2001 From: frostming Date: Mon, 4 May 2020 20:51:15 +0800 Subject: [PATCH] don't fallback to python unconstrained version --- news/4232.bugfix.rst | 1 + pipenv/utils.py | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 news/4232.bugfix.rst diff --git a/news/4232.bugfix.rst b/news/4232.bugfix.rst new file mode 100644 index 00000000..1138fb9a --- /dev/null +++ b/news/4232.bugfix.rst @@ -0,0 +1 @@ +Don't fallback to system Python when no matching Python version is found. diff --git a/pipenv/utils.py b/pipenv/utils.py index eb1f6519..c3cd5d7d 100644 --- a/pipenv/utils.py +++ b/pipenv/utils.py @@ -2200,8 +2200,7 @@ def find_python(finder, line=None): if not result and not line.startswith("python"): line = "python{0}".format(line) result = find_python(finder, line) - if not result: - result = next(iter(finder.find_all_python_versions()), None) + if result: if not isinstance(result, six.string_types): return result.path.as_posix()