Browse Source

vpython: Specify interpreter to run.

Specify the interpreter to run to avoid issues with several
python installations on Windows.

Bug: 1036606

Change-Id: Ib70d041acc52c940711460219acd8f4ad58637a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1992608
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Edward Lesmes 5 years ago
parent
commit
797d74a266
3 changed files with 5 additions and 5 deletions
  1. 1 1
      vpython.bat
  2. 3 3
      vpython3
  3. 1 1
      vpython3.bat

+ 1 - 1
vpython.bat

@@ -4,4 +4,4 @@
 :: found in the LICENSE file.
 :: found in the LICENSE file.
 
 
 call "%~dp0\cipd_bin_setup.bat" > nul 2>&1
 call "%~dp0\cipd_bin_setup.bat" > nul 2>&1
-"%~dp0\.cipd_bin\vpython.exe" %*
+"%~dp0\.cipd_bin\vpython.exe" -vpython-interpreter "%~dp0\python.bat" %*

+ 3 - 3
vpython3

@@ -47,7 +47,7 @@ if [[ $MINGW != 0 && $DEPOT_TOOLS_BOOTSTRAP_PYTHON3 != 0 ]]; then
     bootstrap_python3
     bootstrap_python3
   fi
   fi
   PYTHON3_BIN_RELDIR="$base_dir/$(cat $base_dir/python3_bin_reldir.txt | xargs echo)"
   PYTHON3_BIN_RELDIR="$base_dir/$(cat $base_dir/python3_bin_reldir.txt | xargs echo)"
-  PATH="$PYTHON3_BIN_RELDIR":"$PYTHON3_BIN_RELDIR/Scripts":"$PATH"
+  exec "$base_dir/.cipd_bin/vpython3" -vpython-interpreter  "$PYTHON3_BIN_RELDIR/bin/python3" "$@"
+else
+	exec "$base_dir/.cipd_bin/vpython3" "$@"
 fi
 fi
-
-exec "$base_dir/.cipd_bin/vpython3" "$@"

+ 1 - 1
vpython3.bat

@@ -9,4 +9,4 @@ for /f %%i in (%~dp0python3_bin_reldir.txt) do set PYTHON3_BIN_RELDIR=%%i
 set PATH=%~dp0%PYTHON3_BIN_RELDIR%;%PATH%
 set PATH=%~dp0%PYTHON3_BIN_RELDIR%;%PATH%
 
 
 call "%~dp0\cipd_bin_setup.bat" > nul 2>&1
 call "%~dp0\cipd_bin_setup.bat" > nul 2>&1
-"%~dp0\.cipd_bin\vpython3.exe" %*
+"%~dp0\.cipd_bin\vpython3.exe" -vpython-interpreter "%~dp0\python3.bat" %*