From e6596746dc95fe658b3a5f0924c10e322c7d8e22 Mon Sep 17 00:00:00 2001 From: Fumitoshi Ukai Date: Wed, 30 Apr 2025 10:26:53 -0700 Subject: [PATCH] better error message from python3 when not initialized Bug: 414330998 Change-Id: I47fcd9571ba3de0a080e31624f9bdf0fa738914a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6498079 Auto-Submit: Fumitoshi Ukai Commit-Queue: Gavin Mak Reviewed-by: Takuto Ikuta Reviewed-by: Gavin Mak --- python-bin/python3 | 8 ++++++++ python-bin/python3.bat | 9 ++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/python-bin/python3 b/python-bin/python3 index a29fdc63cf..111ec2d83a 100755 --- a/python-bin/python3 +++ b/python-bin/python3 @@ -2,6 +2,14 @@ DEPOT_TOOLS=$(dirname "$0")/.. +if [[ ! -f "$DEPOT_TOOLS/python3_bin_reldir.txt" ]]; then + cat >&2 <&2 + echo running gclient or update_depot_tools >&2 + exit /b 1 +) + +:Initialized for /f %%i in (%PARENT_DIR%\python3_bin_reldir.txt) do set PYTHON_BIN_ABSDIR=%PARENT_DIR%\%%i set PATH=%PYTHON_BIN_ABSDIR%;%PYTHON_BIN_ABSDIR%\Scripts;%PATH% -"%PYTHON_BIN_ABSDIR%\python3.exe" %* \ No newline at end of file +"%PYTHON_BIN_ABSDIR%\python3.exe" %*