diff --git a/gn b/gn index df56bd0e54..9abc58ac4a 100755 --- a/gn +++ b/gn @@ -11,4 +11,4 @@ if [ "$(expr "$(uname -s)" : "^MINGW64_NT")" == "10" ]; then exit fi -PYTHONDONTWRITEBYTECODE=1 exec python3 "$base_dir/gn.py" "$@" +PYTHONDONTWRITEBYTECODE=1 "$base_dir/python-bin/python3" "$base_dir/gn.py" "$@" diff --git a/gn.bat b/gn.bat index 7403bfb57e..5a7c19ab99 100644 --- a/gn.bat +++ b/gn.bat @@ -8,5 +8,7 @@ setlocal :: standalone, but allow other PATH manipulations to take priority. set PATH=%PATH%;%~dp0 +set scriptdir=%~dp0 + :: Defer control. -python3 "%~dp0\gn.py" %* +@call %scriptdir%python-bin\python3 "%~dp0\gn.py" %* diff --git a/presubmit_canned_checks.py b/presubmit_canned_checks.py index 66971c1815..af3548faab 100644 --- a/presubmit_canned_checks.py +++ b/presubmit_canned_checks.py @@ -1876,7 +1876,11 @@ def CheckGNFormatted(input_api, output_api): ).endswith('.gni') or x.LocalPath().endswith('.typemap')) warnings = [] for f in affected_files: - cmd = ['gn', 'format', '--dry-run', f.AbsoluteLocalPath()] + cmd = [ + input_api.python3_executable, + input_api.os_path.join(_HERE, 'gn.py'), 'format', '--dry-run', + f.AbsoluteLocalPath() + ] rc = gn.main(cmd) if rc == 2: warnings.append(