fix 'system' python to be present if 'python3' is on path but not 'python'

This commit is contained in:
Paul Bransford 2020-07-07 18:39:52 -04:00
parent 366c980166
commit 4d762bca7b
2 changed files with 2 additions and 2 deletions

View file

@ -30,7 +30,7 @@ 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)"; 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
PYENV_PREFIX_PATH="${PYTHON_PATH%/bin/*}"
PYENV_PREFIX_PATH="${PYENV_PREFIX_PATH:-/}"
else

View file

@ -102,7 +102,7 @@ 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; 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); then
print_version system
fi