From bf9dbfd5b95c44b14a8a6af8ecf965ecea50fb29 Mon Sep 17 00:00:00 2001 From: Arthur Noel Date: Mon, 17 Mar 2014 17:31:21 +0000 Subject: [PATCH] Support $PYTHONUSERBASE per PEP 370 Signed-off-by: Sorin Ionescu --- modules/python/init.zsh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/python/init.zsh b/modules/python/init.zsh index fa9175e5..5715b024 100644 --- a/modules/python/init.zsh +++ b/modules/python/init.zsh @@ -16,9 +16,12 @@ elif (( $+commands[pyenv] )); then eval "$(pyenv init -)" # Prepend PEP 370 per user site packages directory, which defaults to -# ~/Library/Python on Mac OS X and ~/.local elsewhere, to PATH. +# ~/Library/Python on Mac OS X and ~/.local elsewhere, to PATH. The +# path can be overridden using PYTHONUSERBASE. else - if [[ "$OSTYPE" == darwin* ]]; then + if [[ -n "$PYTHONUSERBASE" ]]; then + path=($PYTHONUSERBASE/bin $path) + elif [[ "$OSTYPE" == darwin* ]]; then path=($HOME/Library/Python/*/bin(N) $path) else # This is subject to change.