From 5ffc8a07f1a89146b7953b77569a3c50b0146889 Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Fri, 18 Aug 2017 07:55:34 -0500 Subject: [PATCH] [python] Ensure availability of virtualenvwrapper file before sourcing it --- modules/python/init.zsh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/python/init.zsh b/modules/python/init.zsh index 7363728..4b07770 100644 --- a/modules/python/init.zsh +++ b/modules/python/init.zsh @@ -108,7 +108,10 @@ if (( $+VIRTUALENVWRAPPER_VIRTUALENV || $+commands[virtualenv] )) && \ ${(@Ov)commands[(I)virtualenvwrapper(_lazy|).sh]} /usr/share/virtualenvwrapper/virtualenvwrapper(_lazy|).sh(OnN) ) - source "${virtenv_sources[1]}" + if (( $#virtenv_sources )); then + source "${virtenv_sources[1]}" + fi + unset virtenv_sources fi fi