Cleanup: change Python version checks to include newer versions
This commit is contained in:
@@ -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)
|
||||
|
@@ -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)
|
||||
|
||||
|
@@ -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()
|
||||
|
Reference in New Issue
Block a user