Commits

Doug Hellmann  committed 42d12d8

use the version of python in the virtualenv instead of depending on the PATH

  • Participants
  • Parent commits 61979ad

Comments (0)

Files changed (2)

File tests/test_support.sh

 }
 
 test_get_python_version () {
-    expected="$($VIRTUALENVWRAPPER_PYTHON -c 'import sys; sys.stdout.write("%s.%s\n" % sys.version_info[:2])')"
+    expected="$($VIRTUAL_ENV/bin/python -c 'import sys; sys.stdout.write("%s.%s\n" % sys.version_info[:2])')"
     echo "Expecting: $expected"
     vers=$(virtualenvwrapper_get_python_version)
     echo "Got      : $vers"

File virtualenvwrapper.sh

 
 # Prints the Python version string for the current interpreter.
 function virtualenvwrapper_get_python_version {
-    # Uses the Python from the virtualenv because we're trying to
-    # determine the version installed there so we can build
-    # up the path to the site-packages directory.
-    python -V 2>&1 | cut -f2 -d' ' | cut -f-2 -d.
+    # Uses the Python from the virtualenv rather than
+    # VIRTUALENVWRAPPER_PYTHON because we're trying to determine the
+    # version installed there so we can build up the path to the
+    # site-packages directory.
+    "$VIRTUAL_ENV/bin/python" -V 2>&1 | cut -f2 -d' ' | cut -f-2 -d.
 }
 
 # Prints the path to the site-packages directory for the current environment.