1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-08 03:23:48 -05:00

Tolerate nonexistent versions from pyenv-version-name in pyenv-which
Some checks failed
macos_build / macos_build (3.10) (push) Has been cancelled
macos_build / macos_build (3.11) (push) Has been cancelled
macos_build / macos_build (3.12) (push) Has been cancelled
macos_build / macos_build (3.13) (push) Has been cancelled
macos_build / macos_build (3.9) (push) Has been cancelled
pyenv_tests / pyenv_tests (macos-13) (push) Has been cancelled
pyenv_tests / pyenv_tests (macos-14) (push) Has been cancelled
pyenv_tests / pyenv_tests (ubuntu-20.04) (push) Has been cancelled
pyenv_tests / pyenv_tests (ubuntu-22.04) (push) Has been cancelled
ubuntu_build / ubuntu_build (3.10) (push) Has been cancelled
ubuntu_build / ubuntu_build (3.11) (push) Has been cancelled
ubuntu_build / ubuntu_build (3.12) (push) Has been cancelled
ubuntu_build / ubuntu_build (3.13) (push) Has been cancelled
ubuntu_build / ubuntu_build (3.9) (push) Has been cancelled

Addendum to #3134 as per https://github.com/pyenv/pyenv/pull/3134#issuecomment-2545710044
This commit is contained in:
Ivan Pozdeev
2024-12-16 21:36:14 +03:00
parent dc873cf568
commit 86be59a6d5
2 changed files with 16 additions and 1 deletions

View File

@@ -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

View File

@@ -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" <<EOF
2.7
3.4
EOF
create_executable "3.4" "python"
mkdir -p "$PYENV_TEST_DIR"
cd "$PYENV_TEST_DIR"
PYENV_VERSION= run pyenv-which python
assert_success "${PYENV_ROOT}/versions/3.4/bin/python"
}
@test "resolves pyenv-latest prefixes" {
create_executable "3.4.2" "python"