From 75c59424e3f11c3e3741d7d574ade51df369a7af Mon Sep 17 00:00:00 2001 From: Anthony Polito Date: Mon, 21 Oct 2019 21:50:21 +0000 Subject: [PATCH] [fetch] use py3 for fetch Bug: 939847 Change-Id: I8c73328363a9ffe506db6ed4e46c72ccad238c3a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1845499 Commit-Queue: Anthony Polito Reviewed-by: Edward Lesmes --- fetch | 6 +++++- fetch.bat | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/fetch b/fetch index 14a142791..fd2830525 100755 --- a/fetch +++ b/fetch @@ -9,4 +9,8 @@ base_dir=$(dirname "$0") # standalone, but allow other PATH manipulations to take priority. PATH=$PATH:$base_dir -PYTHONDONTWRITEBYTECODE=1 exec vpython "$base_dir/fetch.py" "$@" +if [[ $GCLIENT_PY3 == 1 ]]; then + PYTHONDONTWRITEBYTECODE=1 exec vpython3 "$base_dir/fetch.py" "$@" +else + PYTHONDONTWRITEBYTECODE=1 exec vpython "$base_dir/fetch.py" "$@" +fi diff --git a/fetch.bat b/fetch.bat index 6afd53092..899972d6c 100755 --- a/fetch.bat +++ b/fetch.bat @@ -12,4 +12,8 @@ call "%~dp0\update_depot_tools.bat" set PATH=%PATH%;%~dp0 :: Defer control. -vpython "%~dp0\fetch.py" %* +IF "%GCLIENT_PY3%" == "1" ( + vpython3 "%~dp0\fetch.py" %*y +) ELSE ( + vpython "%~dp0\fetch.py" %* +)