Skip to content

Commit b216a86

Browse files
committed
fix #41 by using the cached python where the wrappers are installed
1 parent 404b5cf commit b216a86

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

ChangeLog

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
2010-04-29 Doug Hellmann <[email protected]>
2+
3+
* virtualenvwrapper.sh (virtualenvwrapper_get_python_version): Add
4+
a comment about why we're using the $PATH python instead of the
5+
one where the wrappers are installed.
6+
(add2virtualenv): Use the install-tree python instead of the one
7+
from $PATH.
8+
19
2010-04-26 Doug Hellmann <[email protected]>
210

311
* virtualenvwrapper.sh (virtualenvwrapper_tempfile): Add a suffix

docs/en/history.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ Dev
88
<http://www.doughellmann.com/docs/virtualenvwrapper/es/>`__ via
99
Manuel Kaufmann's fork at
1010
http://bitbucket.org/humitos/virtualenvwrapper-es-translation/
11+
- Fixed improper use of python from ``$PATH`` instead of the
12+
location where the wrappers are installed. See `issue #41
13+
<http://bitbucket.org/dhellmann/virtualenvwrapper/issue/41/>`__.
1114

1215
2.1
1316

virtualenvwrapper.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,9 @@ fi
308308

309309
# Prints the Python version string for the current interpreter.
310310
virtualenvwrapper_get_python_version () {
311+
# Uses the Python from the virtualenv because we're trying to
312+
# determine the version installed there so we can build
313+
# up the path to the site-packages directory.
311314
python -c 'import sys; print ".".join(str(p) for p in sys.version_info[:2])'
312315
}
313316

@@ -357,7 +360,7 @@ add2virtualenv () {
357360
touch "$path_file"
358361
for pydir in "$@"
359362
do
360-
absolute_path=$(python -c "import os; print os.path.abspath(\"$pydir\")")
363+
absolute_path=$("$VIRTUALENVWRAPPER_PYTHON" -c "import os; print os.path.abspath(\"$pydir\")")
361364
if [ "$absolute_path" != "$pydir" ]
362365
then
363366
echo "Warning: Converting \"$pydir\" to \"$absolute_path\"" 1>&2

0 commit comments

Comments
 (0)