mirror of
				https://github.com/dcarrillo/prezto.git
				synced 2025-11-03 23:19:09 +00:00 
			
		
		
		
	Merge pull request #1981 from zbirenbaum/python_fix
Fix crash on open caused by incorrect conditional in python module
This commit is contained in:
		@@ -114,33 +114,34 @@ 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)"
 | 
				
			||||||
 | 
					 | 
				
			||||||
    # Optionally activate 'virtualenvwrapper' plugin when available.
 | 
					 | 
				
			||||||
    if (( $pyenv_plugins[(i)virtualenvwrapper(_lazy|)] <= $#pyenv_plugins )); then
 | 
					 | 
				
			||||||
      pyenv "$pyenv_plugins[(R)virtualenvwrapper(_lazy|)]"
 | 
					 | 
				
			||||||
    fi
 | 
					 | 
				
			||||||
  else
 | 
					 | 
				
			||||||
    # Fallback to 'virtualenvwrapper' without 'pyenv' wrapper if 'python' is
 | 
					 | 
				
			||||||
    # available in '$path'.
 | 
					 | 
				
			||||||
    if (( ! $+VIRTUALENVWRAPPER_PYTHON )) && (( $#commands[(i)python[23]#] )); then
 | 
					 | 
				
			||||||
      VIRTUALENVWRAPPER_PYTHON=$commands[(i)python[23]#]
 | 
					 | 
				
			||||||
    fi
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    virtenv_sources=(
 | 
					 | 
				
			||||||
      ${(@Ov)commands[(I)virtualenvwrapper(_lazy|).sh]}
 | 
					 | 
				
			||||||
      /usr/share/virtualenvwrapper/virtualenvwrapper(_lazy|).sh(OnN)
 | 
					 | 
				
			||||||
    )
 | 
					 | 
				
			||||||
    if (( $#virtenv_sources )); then
 | 
					 | 
				
			||||||
      source "$virtenv_sources[1]"
 | 
					 | 
				
			||||||
    fi
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    unset virtenv_sources
 | 
					 | 
				
			||||||
  fi
 | 
					  fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  # Optionally activate 'virtualenvwrapper' plugin when available.
 | 
				
			||||||
 | 
					  if (( $pyenv_plugins[(i)virtualenvwrapper(_lazy|)] <= $#pyenv_plugins )); then
 | 
				
			||||||
 | 
					    pyenv "$pyenv_plugins[(R)virtualenvwrapper(_lazy|)]"
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
  unset pyenv_plugins
 | 
					  unset pyenv_plugins
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
 | 
					else
 | 
				
			||||||
 | 
					  # Fallback to 'virtualenvwrapper' without 'pyenv' wrapper if 'python' is
 | 
				
			||||||
 | 
					  # available in '$path'.
 | 
				
			||||||
 | 
					  if (( ! $+VIRTUALENVWRAPPER_PYTHON )) && (( $#commands[(i)python[23]#] )); then
 | 
				
			||||||
 | 
					    VIRTUALENVWRAPPER_PYTHON=$commands[(i)python[23]#]
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtenv_sources=(
 | 
				
			||||||
 | 
					    ${(@Ov)commands[(I)virtualenvwrapper(_lazy|).sh]}
 | 
				
			||||||
 | 
					    /usr/share/virtualenvwrapper/virtualenvwrapper(_lazy|).sh(OnN)
 | 
				
			||||||
 | 
					  )
 | 
				
			||||||
 | 
					  if (( $#virtenv_sources )); then
 | 
				
			||||||
 | 
					    source "$virtenv_sources[1]"
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  unset virtenv_sources
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Load conda into the shell session, if requested.
 | 
					# Load conda into the shell session, if requested.
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user