mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-07 21:51:25 -07:00
Merge pull request #2624 from pmzqla/python
Prefer python3 over python2
This commit is contained in:
commit
d6af4683bb
6 changed files with 54 additions and 10 deletions
|
@ -1763,11 +1763,12 @@ QString Preferences::getPythonPath()
|
|||
return path;
|
||||
|
||||
// Fallback: Detect python from default locations
|
||||
QStringList supported_versions;
|
||||
supported_versions << "34" << "33" << "32" << "31" << "30" << "27" << "26" << "25";
|
||||
foreach (const QString &v, supported_versions)
|
||||
if (QFile::exists("C:/Python" + v + "/python.exe"))
|
||||
return "C:/Python" + v;
|
||||
const QStringList dirs = QDir("C:/").entryList(QStringList("Python*"), QDir::Dirs, QDir::Name | QDir::Reversed);
|
||||
foreach (const QString &dir, dirs) {
|
||||
const QString path("C:/" + dir + "/python.exe");
|
||||
if (QFile::exists(path))
|
||||
return path;
|
||||
}
|
||||
|
||||
return QString();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue