From fe861f8983ce732f34f3389b031030989f37d5e2 Mon Sep 17 00:00:00 2001 From: Wen Date: Wed, 14 Oct 2026 16:40:36 -0300 Subject: [PATCH] test(delivery-gate): select an interpreter only if it runs Python 3 Signed-off-by: Wen --- tests/skills/delivery-gate-quality-gate.test.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/skills/delivery-gate-quality-gate.test.js b/tests/skills/delivery-gate-quality-gate.test.js index ed55124e6..106881775 100644 --- a/tests/skills/delivery-gate-quality-gate.test.js +++ b/tests/skills/delivery-gate-quality-gate.test.js @@ -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, });