File tree Expand file tree Collapse file tree 1 file changed +12
-16
lines changed
Expand file tree Collapse file tree 1 file changed +12
-16
lines changed Original file line number Diff line number Diff line change 4545#
4646
4747# Locate the global Python where virtualenvwrapper is installed.
48- # Use the highest Python version
4948if [ " ${VIRTUALENVWRAPPER_PYTHON:- } " = " " ]
5049then
51- for NAME in python3 python2 python
52- do
53- python_executable= " $( which $NAME 2> /dev/null ) "
54- if ! [ -z " $python_executable " ]
50+ _virtualenvwrapper_python_executable= " $( which python3 2> /dev/null ) "
51+ if ! [ -z " $python_executable " ]
52+ then
53+ if $_virtualenvwrapper_python_executable -m ' virtualenvwrapper.hook_loader ' --help > /dev/null 2>&1
5554 then
56- if $python_executable -m ' virtualenvwrapper.hook_loader' --help > /dev/null 2>&1
57- then
58- VIRTUALENVWRAPPER_PYTHON=$python_executable
59- break
60- fi
55+ VIRTUALENVWRAPPER_PYTHON=$_virtualenvwrapper_python_executable
56+ break
6157 fi
62- done
63- if [ " ${VIRTUALENVWRAPPER_PYTHON:- } " = " " ]
64- then
65- echo -e " ERROR: Python with virtualenvwrapper module not found!
58+ fi
59+ fi
60+ if [ " ${VIRTUALENVWRAPPER_PYTHON:- } " = " " ]
61+ then
62+ echo -e " ERROR: Python with virtualenvwrapper module not found!
6663Either, install virtualenvwrapper module for standard python2
6764or python3 or set VIRTUALENVWRAPPER_PYTHON variable manually." 1>&2
68- return 1
69- fi
65+ return 1
7066fi
7167
7268# Set the name of the virtualenv app to use.
You can’t perform that action at this time.
0 commit comments