diff --git a/libexec/pyenv-which b/libexec/pyenv-which index 4f012596..9ff3ddae 100755 --- a/libexec/pyenv-which +++ b/libexec/pyenv-which @@ -59,7 +59,7 @@ if [ -z "$PYENV_COMMAND" ]; then fi OLDIFS="$IFS" -IFS=: versions=(${PYENV_VERSION:-$(pyenv-version-name)}) +IFS=: versions=(${PYENV_VERSION:-$(pyenv-version-name -f)}) IFS="$OLDIFS" declare -a nonexistent_versions diff --git a/test/which.bats b/test/which.bats index cdcd24e3..6582fddc 100644 --- a/test/which.bats +++ b/test/which.bats @@ -153,6 +153,21 @@ SH assert_success "${PYENV_ROOT}/versions/3.4/bin/python" } +@test "tolerates nonexistent versions from pyenv-version-name" { + mkdir -p "$PYENV_ROOT" + cat > "${PYENV_ROOT}/version" <