Browse files

Update modules/python/init.zsh

support virtualenvwrapper when installed in bash_completion.d
  • Loading branch information...
1 parent 2250f93 commit 96753dce0b9fb9a63f4b65f82c2655b3f3043eb3 James Casbon committed Aug 16, 2012
Showing with 2 additions and 0 deletions.
  1. +2 −0 modules/python/init.zsh
View
2 modules/python/init.zsh
@@ -25,5 +25,7 @@ fi
# Load virtualenvwrapper into the shell session.
if [[ -n "$WORKON_HOME" ]] && (( $+commands[virtualenvwrapper.sh] )); then
source "$commands[virtualenvwrapper.sh]"
+elif [[ -e "/etc/bash_completion.d/virtualenvwrapper" ]]; then
@lunaryorn
lunaryorn added a line comment Aug 16, 2012

This branch is also entered if $WORKON_HOME is unset. In this case virtualenvwrapper is not configured and sourcing it makes absolutely no sense. It will actually fail and display an error message.

Fix the condition to only fall back to bash_completion.d if (( $+commands[virtualenvwrapper.sh] )) fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ source "/etc/bash_completion.d/virtualenvwrapper"
fi

0 comments on commit 96753dc

Please sign in to comment.