build: always use python3 in script/lib/get-version.js (#45400)

build: always use python3 in script/lib/get-version.js
This commit is contained in:
David Sanders 2025-02-03 13:13:36 -08:00 committed by GitHub
parent 9971087678
commit 9f1bb531ba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 3 deletions

View file

@ -19,10 +19,8 @@ module.exports.getElectronVersion = () => {
// Error may happen when trying to get version before running gn, which is a
// valid case and error will be ignored.
}
// Most win32 machines have python.exe but no python3.exe.
const python = process.platform === 'win32' ? 'python.exe' : 'python3';
// Get the version from git tag if it is not defined in gn args.
const output = spawnSync(python, [path.join(ELECTRON_DIR, 'script', 'get-git-version.py')]);
const output = spawnSync('python3', [path.join(ELECTRON_DIR, 'script', 'get-git-version.py')]);
if (output.status !== 0) {
throw new Error(`Failed to get git tag, script quit with ${output.status}: ${output.stdout}`);
}