Browse Source

python: only override virtualenv python if not set

Fixes #1520
master
Kaleb Elwert 7 years ago
parent
commit
84547e28bb
  1. 2
      modules/autosuggestions/external
  2. 17
      modules/python/init.zsh

2
modules/autosuggestions/external

@ -1 +1 @@ @@ -1 +1 @@
Subproject commit 15931f04ffac91a2f9a1a044b6b3ee4050751064
Subproject commit 9f9237ab8a530eeff389161202bbc7283ad6af3e

17
modules/python/init.zsh

@ -116,16 +116,19 @@ if (( $+VIRTUALENVWRAPPER_VIRTUALENV || $+commands[virtualenv] )) && \ @@ -116,16 +116,19 @@ if (( $+VIRTUALENVWRAPPER_VIRTUALENV || $+commands[virtualenv] )) && \
# in '$path' or in an alternative location on a Debian based system.
#
# If the python-path was manually specified, use that. Otherwise, if
# homebrew is installed we fall back to python3 then python2 in that
# order. This is needed to fix an issue with virtualenvwrapper as homebrew
# no longer shadows the system python.
# homebrew is installed and it wasn't overridden via environment variable
# we fall back to python3 then python2 in that order. This is needed to
# fix an issue with virtualenvwrapper as homebrew no longer shadows the
# system python.
zstyle -s ':prezto:module:python:virtualenvwrapper' python-path '_venv_python'
if [[ -n "$_venv_python" ]]; then
export VIRTUALENVWRAPPER_PYTHON=$_venv_python
elif (( $+commands[brew] )) && (( $+commands[python3] )); then
export VIRTUALENVWRAPPER_PYTHON=$commands[python3]
elif (( $+commands[brew] )) && (( $+commands[python2] )); then
export VIRTUALENVWRAPPER_PYTHON=$commands[python2]
elif [[ -z "$VIRTUALENVWRAPPER_PYTHON" ]] && (( $+commands[brew] )); then
if (( $+commands[python3] )); then
export VIRTUALENVWRAPPER_PYTHON=$commands[python3]
elif (( $+commands[python2] )); then
export VIRTUALENVWRAPPER_PYTHON=$commands[python2]
fi
fi
virtenv_sources=(

Loading…
Cancel
Save