diff --git a/fetch b/fetch index 14a142791b..fd28305258 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 6afd53092c..899972d6c3 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" %* +)