Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion boot/bootloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,12 @@ def check_for_python(path, found=None, venv=False):
except:
continue

major, minor, patch = versiontext.split('.')
versionparts = versiontext.split('.')
# file may not be a python executable
if len(versionparts) < 3:
continue

major, minor, patch = versionparts

if not patch.isdigit():
fixed = ''
Expand Down Expand Up @@ -257,6 +262,10 @@ def check_for_python(path, found=None, venv=False):
installed.extend(check_for_python('/usr/bin') or [])
installed.extend(check_for_python('/usr/local/bin', found=installed) or [])

pyenv_shims = os.path.expanduser('~/.pyenv/shims')
if os.path.exists(pyenv_shims):
installed.extend(check_for_python(pyenv_shims, found=installed) or [])

if os.path.exists('/Library/Frameworks/Python.framework/Versions'):
for item in os.listdir('/Library/Frameworks/Python.framework/Versions'):
installed.extend(check_for_python(f'/Library/Frameworks/Python.framework/Versions/{item}/bin', found=installed) or [])
Expand Down