Skip to content

Commit

Permalink
handle python major and minor version correctly in create_pipfile
Browse files Browse the repository at this point in the history
fix #4379
previous code cannot handle 3.XX
  • Loading branch information
yosmoc committed Aug 28, 2020
1 parent 7a7100e commit f380a55
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pipenv/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -756,8 +756,8 @@ def create_pipfile(self, python=None):
else:
required_python = self.which("python")
version = python_version(required_python) or PIPENV_DEFAULT_PYTHON_VERSION
if version and len(version) >= 3:
data[u"requires"] = {"python_version": version[: len("2.7")]}
if version and len(version.split(".")) > 2:
data[u"requires"] = {"python_version": ".".join(version.split(".")[:2])}
self.write_toml(data)

@classmethod
Expand Down

0 comments on commit f380a55

Please sign in to comment.