Skip to content

Commit 5cef966

Browse files
committed
Make --python option to mkvirtualenv not sticky
Fixes a problem with mkvirtualenv in which the value provided to --python is retained for subsequent calls. Fixes issue #178
1 parent ea8257f commit 5cef966

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

docs/source/history.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ dev
99
completion. Contributed by :bbuser:`davidszotten`.
1010
- Fix an issue with listing project templates if none are
1111
installed. (:bbissue:`179`)
12+
- Fix an issue with the ``--python`` option to ``mkvirtualenv``
13+
becoming *sticky* for future calls that do not explicitly specify
14+
the option. (:bbissue:`178`)
1215

1316
3.7
1417

tests/test_mkvirtualenv.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,5 +166,13 @@ test_virtualenv_fails () {
166166
VIRTUALENVWRAPPER_VIRTUALENV=virtualenv
167167
}
168168

169+
test_mkvirtualenv_python_not_sticky () {
170+
typeset _save=$VIRTUALENVWRAPPER_VIRTUALENV
171+
VIRTUALENVWRAPPER_VIRTUALENV=true
172+
mkvirtualenv --python blah foo
173+
assertSame "" "$interpreter"
174+
VIRTUALENVWRAPPER_VIRTUALENV=$_save
175+
}
176+
169177

170178
. "$test_dir/shunit2"

virtualenvwrapper.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@ function mkvirtualenv {
374374
typeset envname
375375
typeset requirements
376376
typeset packages
377+
typeset interpreter
377378

378379
in_args=( "$@" )
379380

0 commit comments

Comments
 (0)