Skip to content

Commit

Permalink
fixes mypy issues
Browse files Browse the repository at this point in the history
  • Loading branch information
bmarroquin committed Jun 6, 2022
1 parent 73f3a4e commit 1581686
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ module = [
'crashtest.*',
'pexpect.*',
'pkginfo.*',
'pythonfinder',
'requests_toolbelt.*',
'shellingham.*',
'virtualenv.*',
Expand Down
10 changes: 5 additions & 5 deletions src/poetry/utils/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,11 +589,11 @@ def _find_python(self, python: str) -> tuple[str, str, str]:
# both are supported as first parameter to Finder.find_python_version
finder = Finder(sort_by_path=True)
try:
path = finder.find_python_version(python)
if path:
minor = f"{path.py_version.major}.{path.py_version.minor}"
patch = f"{minor}.{path.py_version.patch}"
return str(path.path), minor, patch
result = finder.find_python_version(python)
if result:
minor = f"{result.py_version.major}.{result.py_version.minor}"
patch = f"{minor}.{result.py_version.patch}"
return str(result.path), minor, patch
except ValueError:
pass

Expand Down

0 comments on commit 1581686

Please sign in to comment.