mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
main: drop Python 2 check
Python 2 can't even parse this code anymore due to syntax changes, so there's no point in checking for it explicitly. Bug: 302871152 Change-Id: I9852ace5f5079d037c60fd3ac490d77e074e6875 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/389434 Commit-Queue: Mike Frysinger <vapier@google.com> Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com> Tested-by: Mike Frysinger <vapier@google.com>
This commit is contained in:
parent
8bc5000423
commit
8f4f98582e
24
main.py
24
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
|
||||
|
Loading…
Reference in New Issue
Block a user