forked from qt-creator/qt-creator
Python: Improve auto detection
Do not list app installer redirectors as python executables. Windows may put empty redirector files with the same name in a path that is prepended to PATH for the respective user. Change-Id: I9418784ef099df72ef8d0426e55198b30fbeed6a Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -405,6 +405,9 @@ static void addPythonsFromPath(QList<Interpreter> &pythons)
|
||||
|
||||
if (HostOsInfo::isWindowsHost()) {
|
||||
for (const FilePath &executable : env.findAllInPath("python")) {
|
||||
// Windows creates empty redirector files that may interfere
|
||||
if (executable.toFileInfo().size() == 0)
|
||||
continue;
|
||||
if (executable.exists() && !alreadyRegistered(pythons, executable))
|
||||
pythons << Interpreter(executable, "Python from Path");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user