1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-17 15:53:45 -05:00

Allow system Python in sbin (#2065)

Arch Linux has Python is sbin as well as bin
This commit is contained in:
native-api
2021-09-15 20:00:49 +03:00
committed by GitHub
parent 1c90a0f864
commit 4f689cdf83
2 changed files with 12 additions and 1 deletions

View File

@@ -33,7 +33,9 @@ OLDIFS="$IFS"
if PYTHON_PATH="$(PYENV_VERSION="${version}" pyenv-which python 2>/dev/null)" || \
PYTHON_PATH="$(PYENV_VERSION="${version}" pyenv-which python3 2>/dev/null)" || \
PYTHON_PATH="$(PYENV_VERSION="${version}" pyenv-which python2 2>/dev/null)"; then
PYENV_PREFIX_PATH="${PYTHON_PATH%/bin/*}"
shopt -s extglob
# In some distros (Arch), Python can be found in sbin as well as bin
PYENV_PREFIX_PATH="${PYTHON_PATH%/?(s)bin/*}"
PYENV_PREFIX_PATH="${PYENV_PREFIX_PATH:-/}"
else
echo "pyenv: system version not found in PATH" >&2