mirror of
https://github.com/affaan-m/ECC.git
synced 2026-10-26 18:35:05 +00:00
test(delivery-gate): select an interpreter only if it runs Python 3
Signed-off-by: Wen <jwcastillo@gmail.com>
This commit is contained in:
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,
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user