Skip to content

Commit

Permalink
fix: find python exe on Windows for RyeProvider
Browse files Browse the repository at this point in the history
Signed-off-by: Frost Ming <me@frostming.com>
  • Loading branch information
frostming committed Dec 7, 2023
1 parent 6ffe9ba commit a3f514c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/findpython/providers/rye.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from findpython.providers.base import BaseProvider
from findpython.python import PythonVersion
from findpython.utils import safe_iter_dir
from findpython.utils import WINDOWS, safe_iter_dir


class RyeProvider(BaseProvider):
Expand All @@ -25,6 +25,9 @@ def find_pythons(self) -> t.Iterable[PythonVersion]:
for child in safe_iter_dir(py_root):
if child.is_symlink(): # registered an existing python
continue
python_bin = child / "install/bin/python3"
if WINDOWS:
python_bin = child / "install/python.exe"
else:
python_bin = child / "install/bin/python3"
if python_bin.exists():
yield self.version_maker(python_bin, _interpreter=python_bin)

0 comments on commit a3f514c

Please sign in to comment.