summaryrefslogtreecommitdiff
path: root/jstests/libs/python.js
blob: 91a54252966f9b0c2c9df3dfe613d4ba79d50b89 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Helper for finding the local python binary.

function getPython3Binary() {
    'use strict';

    let cmd = '/opt/mongodbtoolchain/v3/bin/python3';
    if (_isWindows()) {
        const paths = ["c:/python36/python.exe", "c:/python/python36/python.exe"];
        for (let p of paths) {
            if (fileExists(p)) {
                cmd = p;
                break;
            }
        }
    }

    assert(fileExists(cmd), "Python3 interpreter not found");
    return cmd;
}