Fix virtualenv-prefix when the version is system

This commit is contained in:
Yamashita Yuu
2014-07-04 22:37:39 +09:00
parent d4ce853e94
commit be18fd294e
2 changed files with 17 additions and 0 deletions

View File

@@ -32,6 +32,10 @@ base_prefix() { # pyvenv
VIRTUALENV_PREFIX_PATHS=()
for version in "${versions[@]}"; do
if [ "$version" = "system" ]; then
echo "pyenv-virtualenv: version \`${version}' is not a virtualenv" 1>&2
exit 1
fi
PREFIX="$(pyenv-prefix "${version}")"
if [ -f "${PREFIX}/bin/activate" ]; then
VIRTUALENV_PREFIX_PATH="$(real_prefix "${version}" || base_prefix "${version}" || true)"