test(delivery-gate): select an interpreter only if it runs Python 3

Signed-off-by: Wen <jwcastillo@gmail.com>
This commit is contained in:
Wen committed 2026-10-14 16:40:36 -03:00
1 parent a1385c4397
commit fe861f8983
1 file changed
+3 -1
@@ -22,8 +22,10 @@ function findPython() {
{ command: 'py', args: ['-3'] },
].filter(candidate => candidate.command);
// Probe for Python 3 itself: a Python 2 `--version` also exits 0, but the
// driver below needs importlib.util.
for (const candidate of candidates) {
const result = spawnSync(candidate.command, [...candidate.args, '--version'], {
const result = spawnSync(candidate.command, [...candidate.args, '-c', 'import sys; sys.exit(sys.version_info[0] != 3)'], {
encoding: 'utf8',
timeout: 5000,
});