From 06001cda910f15ae9a9aa76421e57bec62f65804 Mon Sep 17 00:00:00 2001 From: Josip Sokcevic Date: Thu, 11 May 2023 17:55:43 +0000 Subject: [PATCH] [py2] Drop envvar to run scripts with py2 R=aravindvasudev@google.com Change-Id: I4c2c8265296f8fa1c2ce9a1e4a0b31d1f1dd39f1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4522398 Reviewed-by: Aravind Vasudevan Commit-Queue: Josip Sokcevic --- fetch | 11 +---------- fetch.bat | 11 +---------- gclient | 11 +---------- gclient.bat | 11 +---------- python_runner.sh | 11 +---------- roll-dep | 11 +---------- roll-dep.bat | 11 +---------- 7 files changed, 7 insertions(+), 70 deletions(-) diff --git a/fetch b/fetch index 4f0065b3d..439fe7711 100755 --- a/fetch +++ b/fetch @@ -9,13 +9,4 @@ base_dir=$(dirname "$0") # standalone, but allow other PATH manipulations to take priority. PATH=$PATH:$base_dir -if [[ $GCLIENT_PY3 == 1 ]]; then - # Explicitly run on Python 3 - PYTHONDONTWRITEBYTECODE=1 exec vpython3 "$base_dir/fetch.py" "$@" -elif [[ $GCLIENT_PY3 == 0 ]]; then - # Explicitly run on Python 2 - PYTHONDONTWRITEBYTECODE=1 exec vpython "$base_dir/fetch.py" "$@" -else - # Run on Python 3, allows default to be flipped. - PYTHONDONTWRITEBYTECODE=1 exec vpython3 "$base_dir/fetch.py" "$@" -fi +PYTHONDONTWRITEBYTECODE=1 exec vpython3 "$base_dir/fetch.py" "$@" diff --git a/fetch.bat b/fetch.bat index 26d8bc130..3eb784535 100755 --- a/fetch.bat +++ b/fetch.bat @@ -16,13 +16,4 @@ IF %ERRORLEVEL% NEQ 0 ( set PATH=%PATH%;%~dp0 :: Defer control. -IF "%GCLIENT_PY3%" == "1" ( - :: Explicitly run on Python 3 - call vpython3 "%~dp0\fetch.py" %* -) ELSE IF "%GCLIENT_PY3%" == "0" ( - :: Explicitly run on Python 2 - call vpython "%~dp0\fetch.py" %* -) ELSE ( - :: Run on Python 3, allows default to be flipped. - call vpython3 "%~dp0\fetch.py" %* -) +call vpython3 "%~dp0\fetch.py" %* diff --git a/gclient b/gclient index 4ef5ab03b..cd77c77d6 100755 --- a/gclient +++ b/gclient @@ -26,13 +26,4 @@ fi # standalone, but allow other PATH manipulations to take priority. PATH=$PATH:$base_dir -if [[ $GCLIENT_PY3 == 1 ]]; then - # Explicitly run on Python 3 - PYTHONDONTWRITEBYTECODE=1 exec vpython3 "$base_dir/gclient.py" "$@" -elif [[ $GCLIENT_PY3 == 0 ]]; then - # Explicitly run on Python 2 - PYTHONDONTWRITEBYTECODE=1 exec vpython "$base_dir/gclient.py" "$@" -else - # Run on Python 3, allows default to be flipped. - PYTHONDONTWRITEBYTECODE=1 exec vpython3 "$base_dir/gclient.py" "$@" -fi +PYTHONDONTWRITEBYTECODE=1 exec vpython3 "$base_dir/gclient.py" "$@" diff --git a/gclient.bat b/gclient.bat index 5a6ca1938..d88a3186e 100755 --- a/gclient.bat +++ b/gclient.bat @@ -20,13 +20,4 @@ IF %ERRORLEVEL% NEQ 0 ( set PATH=%PATH%;%~dp0 :: Defer control. -IF "%GCLIENT_PY3%" == "1" ( - :: Explicitly run on Python 3 - call vpython3 "%~dp0gclient.py" %* -) ELSE IF "%GCLIENT_PY3%" == "0" ( - :: Explicitly run on Python 2 - call vpython "%~dp0gclient.py" %* -) ELSE ( - :: Run on Python 3, allows default to be flipped. - call vpython3 "%~dp0gclient.py" %* -) +call vpython3 "%~dp0gclient.py" %* diff --git a/python_runner.sh b/python_runner.sh index 0e4a3dca6..cf48c9a93 100755 --- a/python_runner.sh +++ b/python_runner.sh @@ -48,13 +48,4 @@ SCRIPT="${SCRIPT-${BASENAME//-/_}.py}" # standalone, but allow other PATH manipulations to take priority. PATH=$PATH:$DEPOT_TOOLS -if [[ $GCLIENT_PY3 = 1 ]]; then - # Explicitly run on Python 3 - vpython3 "$DEPOT_TOOLS/$SCRIPT" "$@" -elif [[ $GCLIENT_PY3 = 0 ]]; then - # Explicitly run on Python 2 - vpython "$DEPOT_TOOLS/$SCRIPT" "$@" -else - # Run on Python 3, allows default to be flipped. - vpython3 "$DEPOT_TOOLS/$SCRIPT" "$@" -fi +vpython3 "$DEPOT_TOOLS/$SCRIPT" "$@" diff --git a/roll-dep b/roll-dep index 6c0e6388c..663231e14 100755 --- a/roll-dep +++ b/roll-dep @@ -9,13 +9,4 @@ base_dir=$(dirname "$0") # standalone, but allow other PATH manipulations to take priority. PATH=$PATH:$base_dir -if [[ $GCLIENT_PY3 = 1 ]]; then - # Explicitly run on Python 3 - PYTHONDONTWRITEBYTECODE=1 exec vpython3 "$base_dir/roll_dep.py" "$@" -elif [[ $GCLIENT_PY3 = 0 ]]; then - # Explicitly run on Python 2 - PYTHONDONTWRITEBYTECODE=1 exec vpython "$base_dir/roll_dep.py" "$@" -else - # Run on Python 2 for now, allows default to be flipped. - PYTHONDONTWRITEBYTECODE=1 exec vpython3 "$base_dir/roll_dep.py" "$@" -fi +PYTHONDONTWRITEBYTECODE=1 exec vpython3 "$base_dir/roll_dep.py" "$@" diff --git a/roll-dep.bat b/roll-dep.bat index 9ad5248a2..75f689eae 100755 --- a/roll-dep.bat +++ b/roll-dep.bat @@ -9,13 +9,4 @@ setlocal set PATH=%PATH%;%~dp0 :: Defer control. -IF "%GCLIENT_PY3%" == "1" ( - :: Explicitly run on Python 3 - call vpython3 "%~dp0\roll_dep.py" %* -) ELSE IF "%GCLIENT_PY3%" == "0" ( - :: Explicitly run on Python 2 - call vpython "%~dp0\roll_dep.py" %* -) ELSE ( - :: Run on Python 3, allows default to be flipped. - call vpython3 "%~dp0\roll_dep.py" %* -) +call vpython3 "%~dp0\roll_dep.py" %*