mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-11 07:46:17 -07:00
Drop python2 support.
This commit is contained in:
parent
a77e1c9f36
commit
7d030b4cd9
11 changed files with 22 additions and 1231 deletions
|
@ -238,14 +238,11 @@ QPoint Utils::Misc::screenCenter(const QWidget *w)
|
|||
int Utils::Misc::pythonVersion()
|
||||
{
|
||||
static int version = -1;
|
||||
if (version < 0) {
|
||||
if (version != 3) {
|
||||
QString versionComplete = pythonVersionComplete().trimmed();
|
||||
QStringList splitted = versionComplete.split('.');
|
||||
if (splitted.size() > 1) {
|
||||
int highVer = splitted.at(0).toInt();
|
||||
if ((highVer == 2) || (highVer == 3))
|
||||
version = highVer;
|
||||
}
|
||||
if (splitted.size() > 1)
|
||||
version = splitted.at(0).toInt();
|
||||
}
|
||||
return version;
|
||||
}
|
||||
|
@ -268,11 +265,6 @@ QString Utils::Misc::pythonExecutable()
|
|||
executable = "python3";
|
||||
return executable;
|
||||
}
|
||||
pythonProc.start("python2", QStringList() << "--version", QIODevice::ReadOnly);
|
||||
if (pythonProc.waitForFinished() && (pythonProc.exitCode() == 0)) {
|
||||
executable = "python2";
|
||||
return executable;
|
||||
}
|
||||
#endif
|
||||
// Look for "python" in Windows and in UNIX if "python2" and "python3" are
|
||||
// not detected.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue