Skip to content

Commit

Permalink
Tweak search for Python paths - make sure to check it exists
Browse files Browse the repository at this point in the history
Thanks to @brockdyer03 for pointing this out on the forum

Signed-off-by: Geoff Hutchison <geoff.hutchison@gmail.com>
  • Loading branch information
ghutchis committed Jan 11, 2025
1 parent 4421877 commit d8c64c9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions avogadro/qtplugins/configurepython/configurepython.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,13 @@ QStringList ConfigurePython::pythonPaths() const

QStringList paths = findExecutablePaths(names);

// Add the current interpreter to the list if it's not already there.
if (!paths.contains(pythonInterp))
paths.prepend(pythonInterp);
// Add the current interpreter to the list if it's not already there
// and it exists as an executable
if (!paths.contains(pythonInterp)) {
QFileInfo info(pythonInterp);
if (info.exists() && info.isExecutable())
paths.prepend(pythonInterp);
}

return paths;
}
Expand Down

0 comments on commit d8c64c9

Please sign in to comment.