diff --git a/libexec/pyenv-prefix b/libexec/pyenv-prefix index a2ee880e..9e20a21a 100755 --- a/libexec/pyenv-prefix +++ b/libexec/pyenv-prefix @@ -30,7 +30,9 @@ OLDIFS="$IFS" { IFS=: for version in ${PYENV_VERSION}; do if [ "$version" = "system" ]; then - if PYTHON_PATH="$(PYENV_VERSION="${version}" pyenv-which python 2>/dev/null)" || PYTHON_PATH="$(PYENV_VERSION="${version}" pyenv-which python3 2>/dev/null)"; then + 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/*}" PYENV_PREFIX_PATH="${PYENV_PREFIX_PATH:-/}" else diff --git a/libexec/pyenv-versions b/libexec/pyenv-versions index 1e3302d2..195f4590 100755 --- a/libexec/pyenv-versions +++ b/libexec/pyenv-versions @@ -102,7 +102,10 @@ print_version() { } # Include "system" in the non-bare output, if it exists -if [ -n "$include_system" ] && (PYENV_VERSION=system pyenv-which python >/dev/null 2>&1 || PYENV_VERSION=system pyenv-which python3 >/dev/null 2>&1); then +if [ -n "$include_system" ] && \ + (PYENV_VERSION=system pyenv-which python >/dev/null 2>&1 || \ + PYENV_VERSION=system pyenv-which python3 >/dev/null 2>&1 || \ + PYENV_VERSION=system pyenv-which python2 >/dev/null 2>&1) ; then print_version system fi