diff options
author | Simo Fält <simo.falt@qt.io> | 2020-05-05 09:04:13 +0300 |
---|---|---|
committer | Simo Fält <simo.falt@qt.io> | 2020-09-24 11:01:51 +0300 |
commit | 9eee97b5e66c9771e428539eb340b2c2a3756968 (patch) | |
tree | 4f5c01a16768675f8adbeb94691f55293cb528f7 /build_scripts | |
parent | cad869b619fdc0969216e6e9b63fd1afb5edb7db (diff) |
Test with additional python version
Change-Id: I17726f6bd02d36a7acc3ed99ca11796b780b837d
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'build_scripts')
-rw-r--r-- | build_scripts/utils.py | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/build_scripts/utils.py b/build_scripts/utils.py index 9f6d472cc..b0c2f8899 100644 --- a/build_scripts/utils.py +++ b/build_scripts/utils.py @@ -1102,13 +1102,23 @@ def get_qtci_virtualEnv(python_ver, host, hostArch, targetArch): _pExe = "python.exe" # With windows we are creating building 32-bit target in 64-bit host if hostArch == "X86_64" and targetArch == "X86": - if python_ver == "3": - _pExe = os.path.join(os.getenv("PYTHON3_32_PATH"), "python.exe") + if python_ver.startswith("3"): + print("Try to find python from {} env variable".format("PYTHON"+python_ver+"-32_PATH")) + _path = os.getenv("PYTHON"+python_ver+"-32_PATH", "") + _pExe = os.path.join(_path, "python.exe") + if not os.path.isfile(_pExe): + print("Can't find python.exe from {}, using default python3".format(_pExe)) + _pExe = os.path.join(os.getenv("PYTHON3_32_PATH"), "python.exe") else: - _pExe = os.path.join(os.getenv("PYTHON2_32_PATH"), "python.exe") + _pExe = os.path.join(os.getenv("PYTHON2_32_PATH"), "python.exe") else: - if python_ver == "3": - _pExe = os.path.join(os.getenv("PYTHON3_PATH"), "python.exe") + if python_ver.startswith("3"): + print("Try to find python from {} env variable".format("PYTHON"+python_ver+"-64_PATH")) + _path = os.getenv("PYTHON"+python_ver+"-64_PATH", "") + _pExe = os.path.join(_path, "python.exe") + if not os.path.isfile(_pExe): + print("Can't find python.exe from {}, using default python3".format(_pExe)) + _pExe = os.path.join(os.getenv("PYTHON3_PATH"), "python.exe") env_python = _env + "\\Scripts\\python.exe" env_pip = _env + "\\Scripts\\pip.exe" else: |