Browse Source

Fix crash on open caused by incorrect conditional in python module

master
zbirenbaum 3 years ago
parent
commit
bb2036b0b3
  1. 11
      modules/python/init.zsh

11
modules/python/init.zsh

@ -114,15 +114,19 @@ if (( $+VIRTUALENVWRAPPER_VIRTUALENV || $+commands[virtualenv] )) \
pyenv_plugins=(${(@oM)${(f)"$(pyenv commands --no-sh 2> /dev/null)"}:#virtualenv*}) pyenv_plugins=(${(@oM)${(f)"$(pyenv commands --no-sh 2> /dev/null)"}:#virtualenv*})
fi fi
# Optionally activate 'virtualenv' plugin when available.
if (( $pyenv_plugins[(i)virtualenv-init] <= $#pyenv_plugins )); then if (( $pyenv_plugins[(i)virtualenv-init] <= $#pyenv_plugins )); then
# Enable 'virtualenv' with 'pyenv'.
eval "$(pyenv virtualenv-init - zsh)" eval "$(pyenv virtualenv-init - zsh)"
fi
# Optionally activate 'virtualenvwrapper' plugin when available. # Optionally activate 'virtualenvwrapper' plugin when available.
if (( $pyenv_plugins[(i)virtualenvwrapper(_lazy|)] <= $#pyenv_plugins )); then if (( $pyenv_plugins[(i)virtualenvwrapper(_lazy|)] <= $#pyenv_plugins )); then
pyenv "$pyenv_plugins[(R)virtualenvwrapper(_lazy|)]" pyenv "$pyenv_plugins[(R)virtualenvwrapper(_lazy|)]"
fi fi
else
unset pyenv_plugins
else
# Fallback to 'virtualenvwrapper' without 'pyenv' wrapper if 'python' is # Fallback to 'virtualenvwrapper' without 'pyenv' wrapper if 'python' is
# available in '$path'. # available in '$path'.
if (( ! $+VIRTUALENVWRAPPER_PYTHON )) && (( $#commands[(i)python[23]#] )); then if (( ! $+VIRTUALENVWRAPPER_PYTHON )) && (( $#commands[(i)python[23]#] )); then
@ -138,9 +142,6 @@ if (( $+VIRTUALENVWRAPPER_VIRTUALENV || $+commands[virtualenv] )) \
fi fi
unset virtenv_sources unset virtenv_sources
fi
unset pyenv_plugins
fi fi
# Load conda into the shell session, if requested. # Load conda into the shell session, if requested.

Loading…
Cancel
Save