diff --git a/main.py b/main.py index 9c62722f..07c360f4 100755 --- a/main.py +++ b/main.py @@ -86,27 +86,19 @@ logger = RepoLogger(__file__) MIN_PYTHON_VERSION_SOFT = (3, 6) MIN_PYTHON_VERSION_HARD = (3, 6) -if sys.version_info.major < 3: +if sys.version_info < MIN_PYTHON_VERSION_HARD: logger.error( - "repo: error: Python 2 is no longer supported; " + "repo: error: Python version is too old; " "Please upgrade to Python %d.%d+.", *MIN_PYTHON_VERSION_SOFT, ) sys.exit(1) -else: - if sys.version_info < MIN_PYTHON_VERSION_HARD: - logger.error( - "repo: error: Python 3 version is too old; " - "Please upgrade to Python %d.%d+.", - *MIN_PYTHON_VERSION_SOFT, - ) - sys.exit(1) - elif sys.version_info < MIN_PYTHON_VERSION_SOFT: - logger.error( - "repo: warning: your Python 3 version is no longer supported; " - "Please upgrade to Python %d.%d+.", - *MIN_PYTHON_VERSION_SOFT, - ) +elif sys.version_info < MIN_PYTHON_VERSION_SOFT: + logger.error( + "repo: warning: your Python version is no longer supported; " + "Please upgrade to Python %d.%d+.", + *MIN_PYTHON_VERSION_SOFT, + ) KEYBOARD_INTERRUPT_EXIT = 128 + signal.SIGINT MAX_PRINT_ERRORS = 5