aboutsummaryrefslogtreecommitdiffstats
path: root/build_scripts
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-09-17 08:08:37 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-09-17 10:42:51 +0200
commit8d2970635b4e5c65dd77f8aa94052e9364eae2c4 (patch)
tree259126aaf32c97a197f57ebb77e5061d7921fd09 /build_scripts
parent38814354ff6a30258b79947304fd3a6be4dc7089 (diff)
qp5_tool: No longer default to 'python3' in virtualenv
This causes problems on Windows where old python3 versions are shipped with Visual Studio and virtualenv does not create a python3.exe. Change-Id: I695fbcd7a007ff72bd4d79399c700bf93a8e4f94 Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'build_scripts')
-rw-r--r--build_scripts/qp5_tool.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/build_scripts/qp5_tool.py b/build_scripts/qp5_tool.py
index b023fc58f..0f3ed6166 100644
--- a/build_scripts/qp5_tool.py
+++ b/build_scripts/qp5_tool.py
@@ -274,7 +274,9 @@ def read_config_python_binary():
binary = read_config(PYTHON_KEY)
if binary:
return binary
- return 'python3' if which('python3') else 'python'
+ # Use 'python3' unless virtualenv is set
+ use_py3 = (not os.environ.get('VIRTUAL_ENV') and which('python3'))
+ return 'python3' if use_py3 else 'python'
def get_config_file(base_name):