From 589872affb167cbd5d611fb99a2771176f258c68 Mon Sep 17 00:00:00 2001 From: Yamashita Yuu Date: Mon, 27 Jan 2014 15:04:51 +0900 Subject: [PATCH] Set proper `PYENV_VERSION` during `pyenv install` --- plugins/python-build/bin/pyenv-install | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/python-build/bin/pyenv-install b/plugins/python-build/bin/pyenv-install index febd3213..cb6cf623 100755 --- a/plugins/python-build/bin/pyenv-install +++ b/plugins/python-build/bin/pyenv-install @@ -161,7 +161,13 @@ fi # unsatisfied local python version can cause the installer to # fail.) if [[ "${VERSION_NAME}" == [23]"."* ]]; then - export PYENV_VERSION="$(pyenv-whence "python${VERSION_NAME%%.${VERSION_NAME##*.}}" 2>/dev/null | tail -1 || true)" + for version in "${VERSION_NAME%-dev}" "${VERSION_NAME%.*}" "${VERSION_NAME%%.*}"; do + PYENV_VERSION="$(pyenv-whence "python${version}" 2>/dev/null | tail -n 1 || true)" + if [ -n "${PYENV_VERSION}" ]; then + export PYENV_VERSION + break + fi + done fi