Cleanup: change Python version checks to include newer versions

This commit is contained in:
Campbell Barton
2020-09-07 22:58:16 +10:00
parent 272c53f8f0
commit 870fcb3857
3 changed files with 5 additions and 5 deletions

View File

@@ -21,7 +21,7 @@
# <pep8 compliant>
import sys
if not sys.version.startswith("3"):
if sys.version_info.major < 3:
print("\nPython3.x needed, found %s.\nAborting!\n" %
sys.version.partition(" ")[0])
sys.exit(1)

View File

@@ -25,8 +25,8 @@ __all__ = (
import sys
if not sys.version.startswith("3"):
print("\nPython3.x needed, found %s.\nAborting!\n" %
if not sys.version_info.major < 3:
print("\nPython3.x or newer needed, found %s.\nAborting!\n" %
sys.version.partition(" ")[0])
sys.exit(1)

View File

@@ -321,7 +321,7 @@ def main():
if __name__ == '__main__':
import sys
if not sys.version.startswith("3"):
print("Incorrect python version, use python 3!")
if sys.version_info.major < 3:
print("Incorrect python version, use Python 3 or newer!")
else:
main()