mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-14 09:13:08 -07:00
Fix python detection when the 'Anaconda' software is installed. Closes #3731.
This commit is contained in:
parent
ff8ff72eab
commit
63df3090d5
1 changed files with 9 additions and 3 deletions
|
@ -300,11 +300,17 @@ QString Utils::Misc::pythonVersionComplete() {
|
||||||
QByteArray output = pythonProc.readAllStandardOutput();
|
QByteArray output = pythonProc.readAllStandardOutput();
|
||||||
if (output.isEmpty())
|
if (output.isEmpty())
|
||||||
output = pythonProc.readAllStandardError();
|
output = pythonProc.readAllStandardError();
|
||||||
const QByteArray versionStr = output.split(' ').last();
|
|
||||||
version = versionStr.trimmed();
|
// Software 'Anaconda' installs its own python interpreter
|
||||||
|
// and `python --version` returns a string like this:
|
||||||
|
// `Python 3.4.3 :: Anaconda 2.3.0 (64-bit)`
|
||||||
|
const QList<QByteArray> verSplit = output.split(' ');
|
||||||
|
if (verSplit.size() > 1) {
|
||||||
|
version = verSplit.at(1).trimmed();
|
||||||
Logger::instance()->addMessage(QCoreApplication::translate("misc", "Python version: %1").arg(version), Log::INFO);
|
Logger::instance()->addMessage(QCoreApplication::translate("misc", "Python version: %1").arg(version), Log::INFO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return version;
|
return version;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue