summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@google.com>2023-10-31 16:49:26 -0400
committerLUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-11-01 17:02:34 +0000
commitd32b2dcd1530a1cf30a4da380ec7388022b4a2bf (patch)
tree1d0a2680576a69e5f94d2e102f258e9119312986
parentb32ccbb66bb16965ecb8b4e266c4e45186636c1b (diff)
downloadgit-repo-d32b2dcd1530a1cf30a4da380ec7388022b4a2bf.tar.gz
repo: Remove unreachable code.
Change-Id: I41371feb88c85e9da0656b9fab04057c22d1dcf4 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/391514 Tested-by: Jason R. Coombs <jaraco@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Commit-Queue: Jason R. Coombs <jaraco@google.com>
-rwxr-xr-xrepo39
1 files changed, 4 insertions, 35 deletions
diff --git a/repo b/repo
index 27381421..704bb2eb 100755
--- a/repo
+++ b/repo
@@ -79,17 +79,6 @@ def check_python_version():
79 major = ver.major 79 major = ver.major
80 minor = ver.minor 80 minor = ver.minor
81 81
82 # Abort on very old Python 2 versions.
83 if (major, minor) < (2, 7):
84 print(
85 "repo: error: Your Python version is too old. "
86 "Please use Python {}.{} or newer instead.".format(
87 *MIN_PYTHON_VERSION_SOFT
88 ),
89 file=sys.stderr,
90 )
91 sys.exit(1)
92
93 # Try to re-exec the version specific Python 3 if needed. 82 # Try to re-exec the version specific Python 3 if needed.
94 if (major, minor) < MIN_PYTHON_VERSION_SOFT: 83 if (major, minor) < MIN_PYTHON_VERSION_SOFT:
95 # Python makes releases ~once a year, so try our min version +10 to help 84 # Python makes releases ~once a year, so try our min version +10 to help
@@ -134,16 +123,7 @@ def check_python_version():
134 reexec("python3") 123 reexec("python3")
135 124
136 # We're still here, so diagnose things for the user. 125 # We're still here, so diagnose things for the user.
137 if major < 3: 126 if (major, minor) < MIN_PYTHON_VERSION_HARD:
138 print(
139 "repo: error: Python 2 is no longer supported; "
140 "Please upgrade to Python {}.{}+.".format(
141 *MIN_PYTHON_VERSION_HARD
142 ),
143 file=sys.stderr,
144 )
145 sys.exit(1)
146 elif (major, minor) < MIN_PYTHON_VERSION_HARD:
147 print( 127 print(
148 "repo: error: Python 3 version is too old; " 128 "repo: error: Python 3 version is too old; "
149 "Please use Python {}.{} or newer.".format( 129 "Please use Python {}.{} or newer.".format(
@@ -170,7 +150,7 @@ if not REPO_REV:
170BUG_URL = "https://issues.gerritcodereview.com/issues/new?component=1370071" 150BUG_URL = "https://issues.gerritcodereview.com/issues/new?component=1370071"
171 151
172# increment this whenever we make important changes to this script 152# increment this whenever we make important changes to this script
173VERSION = (2, 39) 153VERSION = (2, 40)
174 154
175# increment this if the MAINTAINER_KEYS block is modified 155# increment this if the MAINTAINER_KEYS block is modified
176KEYRING_VERSION = (2, 3) 156KEYRING_VERSION = (2, 3)
@@ -274,19 +254,8 @@ import optparse
274import re 254import re
275import shutil 255import shutil
276import stat 256import stat
277 257import urllib.error
278 258import urllib.request
279if sys.version_info[0] == 3:
280 import urllib.error
281 import urllib.request
282else:
283 import imp
284
285 import urllib2
286
287 urllib = imp.new_module("urllib")
288 urllib.request = urllib2
289 urllib.error = urllib2
290 259
291 260
292repo_config_dir = os.getenv("REPO_CONFIG_DIR", os.path.expanduser("~")) 261repo_config_dir = os.getenv("REPO_CONFIG_DIR", os.path.expanduser("~"))