summaryrefslogtreecommitdiffstats
path: root/main.py
diff options
context:
space:
mode:
authorMike Frysinger <vapier@google.com>2020-09-06 13:33:45 -0400
committerMike Frysinger <vapier@google.com>2020-11-17 15:04:20 +0000
commita488af5ea5c53dd7cf2c90a751e77cc4ba87b7c3 (patch)
tree086d556e3834b06a2bb037b7d1a4d8af0d2b8e3f /main.py
parente283b95cf2c95befcb2b67259fd8877c1c36d25e (diff)
downloadgit-repo-a488af5ea5c53dd7cf2c90a751e77cc4ba87b7c3.tar.gz
main: require Python 3 now
We've been warning about this for more than 6 months (with public announcements even older). Lets make it a failure now to see who hasn't upgraded yet. Bug: https://crbug.com/gerrit/10418 Change-Id: Iec3e2cbf87de434021921616683d360bc4fef77a Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/280796 Reviewed-by: Michael Mortensen <mmortensen@google.com> Tested-by: Mike Frysinger <vapier@google.com>
Diffstat (limited to 'main.py')
-rwxr-xr-xmain.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/main.py b/main.py
index 1d73fce3..cd62793d 100755
--- a/main.py
+++ b/main.py
@@ -1,4 +1,4 @@
1#!/usr/bin/env python 1#!/usr/bin/env python3
2# -*- coding:utf-8 -*- 2# -*- coding:utf-8 -*-
3# 3#
4# Copyright (C) 2008 The Android Open Source Project 4# Copyright (C) 2008 The Android Open Source Project
@@ -85,9 +85,10 @@ MIN_PYTHON_VERSION_SOFT = (3, 6)
85MIN_PYTHON_VERSION_HARD = (3, 4) 85MIN_PYTHON_VERSION_HARD = (3, 4)
86 86
87if sys.version_info.major < 3: 87if sys.version_info.major < 3:
88 print('repo: warning: Python 2 is no longer supported; ' 88 print('repo: error: Python 2 is no longer supported; '
89 'Please upgrade to Python {}.{}+.'.format(*MIN_PYTHON_VERSION_SOFT), 89 'Please upgrade to Python {}.{}+.'.format(*MIN_PYTHON_VERSION_SOFT),
90 file=sys.stderr) 90 file=sys.stderr)
91 sys.exit(1)
91else: 92else:
92 if sys.version_info < MIN_PYTHON_VERSION_HARD: 93 if sys.version_info < MIN_PYTHON_VERSION_HARD:
93 print('repo: error: Python 3 version is too old; ' 94 print('repo: error: Python 3 version is too old; '