diff options
author | David Schulz <david.schulz@qt.io> | 2021-12-09 12:46:24 +0100 |
---|---|---|
committer | David Schulz <david.schulz@qt.io> | 2021-12-10 08:44:15 +0000 |
commit | cfdf61367998cf1107d0680d2c74f1fd21900b12 (patch) | |
tree | 71bc50eb55f57659941d6cdc7529f1179fa40df4 | |
parent | d681933a6bd3c6cc3c934b0ad4bf98d07232c1c8 (diff) |
Python: prefer python3 from path as default interpreter
Change-Id: Ic53fc19f59da29d55c8f59385afc74a2524d6e49
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
-rw-r--r-- | src/plugins/python/pythonsettings.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/python/pythonsettings.cpp b/src/plugins/python/pythonsettings.cpp index 4bc3e0ca7b..314b3dc3ad 100644 --- a/src/plugins/python/pythonsettings.cpp +++ b/src/plugins/python/pythonsettings.cpp @@ -436,7 +436,9 @@ static void addPythonsFromPath(QList<Interpreter> &pythons) static QString idForPythonFromPath(QList<Interpreter> pythons) { - const FilePath &pythonFromPath = Environment::systemEnvironment().searchInPath("python"); + FilePath pythonFromPath = Environment::systemEnvironment().searchInPath("python3"); + if (pythonFromPath.isEmpty()) + pythonFromPath = Environment::systemEnvironment().searchInPath("python"); if (pythonFromPath.isEmpty()) return {}; const Interpreter &defaultInterpreter |