Drop python2 support

Closes #11811.
This commit is contained in:
Chocobo1 2020-01-03 10:54:27 +08:00
parent 8b330e3ac0
commit baa13c044a
No known key found for this signature in database
GPG key ID: 210D9C873253A68C
12 changed files with 16 additions and 1247 deletions

View file

@ -240,10 +240,7 @@ bool Utils::ForeignApps::PythonInfo::isValid() const
bool Utils::ForeignApps::PythonInfo::isSupportedVersion() const
{
const int majorVer = version.majorNumber();
return ((majorVer > 3)
|| ((majorVer == 3) && (version >= Version {3, 3, 0}))
|| ((majorVer == 2) && (version >= Version {2, 7, 9})));
return (version >= Version {3, 3, 0});
}
PythonInfo Utils::ForeignApps::pythonInfo()
@ -251,14 +248,12 @@ PythonInfo Utils::ForeignApps::pythonInfo()
static PythonInfo pyInfo;
if (!pyInfo.isValid()) {
#if defined(Q_OS_UNIX)
// On Unix-Like Systems python2 and python3 should always exist
// On Unix-Like systems python3 should always exist
// https://www.python.org/dev/peps/pep-0394/
if (testPythonInstallation("python3", pyInfo))
return pyInfo;
if (testPythonInstallation("python2", pyInfo))
return pyInfo;
#endif
// Look for "python" in Windows and in UNIX if "python2" and "python3" are
// Look for "python" in Windows and in UNIX if "python3" is
// not detected.
if (testPythonInstallation("python", pyInfo))
return pyInfo;