From 980159f2211894c3593a74b16ed8703ec885a72e Mon Sep 17 00:00:00 2001 From: "Yamashita, Yuu" Date: Thu, 29 Mar 2018 00:39:30 +0000 Subject: [PATCH] Use custom get-pip URL based on the target version (pyenv/pyenv#1127) --- bin/pyenv-virtualenv | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/bin/pyenv-virtualenv b/bin/pyenv-virtualenv index ff29cfc..326e0b7 100755 --- a/bin/pyenv-virtualenv +++ b/bin/pyenv-virtualenv @@ -463,7 +463,21 @@ if [ -z "${GET_PIP_URL}" ]; then # Unset `PIP_VERSION` from environment before invoking `get-pip.py` to deal with "ValueError: invalid truth value" (pypa/pip#4528) unset PIP_VERSION else - GET_PIP_URL="https://bootstrap.pypa.io/get-pip.py" + # Use custom get-pip URL based on the target version (#1127) + case "${DEFINITION_PATH##*/}" in + 2.6 | 2.6.* ) + GET_PIP_URL="https://bootstrap.pypa.io/2.6/get-pip.py" + ;; + 3.2 | 3.2.* ) + GET_PIP_URL="https://bootstrap.pypa.io/3.2/get-pip.py" + ;; + 3.3 | 3.3.* ) + GET_PIP_URL="https://bootstrap.pypa.io/3.3/get-pip.py" + ;; + * ) + GET_PIP_URL="https://bootstrap.pypa.io/get-pip.py" + ;; + esac fi fi