mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
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>
This commit is contained in:
parent
b32ccbb66b
commit
d32b2dcd15
39
repo
39
repo
@ -79,17 +79,6 @@ def check_python_version():
|
||||
major = ver.major
|
||||
minor = ver.minor
|
||||
|
||||
# Abort on very old Python 2 versions.
|
||||
if (major, minor) < (2, 7):
|
||||
print(
|
||||
"repo: error: Your Python version is too old. "
|
||||
"Please use Python {}.{} or newer instead.".format(
|
||||
*MIN_PYTHON_VERSION_SOFT
|
||||
),
|
||||
file=sys.stderr,
|
||||
)
|
||||
sys.exit(1)
|
||||
|
||||
# Try to re-exec the version specific Python 3 if needed.
|
||||
if (major, minor) < MIN_PYTHON_VERSION_SOFT:
|
||||
# Python makes releases ~once a year, so try our min version +10 to help
|
||||
@ -134,16 +123,7 @@ def check_python_version():
|
||||
reexec("python3")
|
||||
|
||||
# We're still here, so diagnose things for the user.
|
||||
if major < 3:
|
||||
print(
|
||||
"repo: error: Python 2 is no longer supported; "
|
||||
"Please upgrade to Python {}.{}+.".format(
|
||||
*MIN_PYTHON_VERSION_HARD
|
||||
),
|
||||
file=sys.stderr,
|
||||
)
|
||||
sys.exit(1)
|
||||
elif (major, minor) < MIN_PYTHON_VERSION_HARD:
|
||||
if (major, minor) < MIN_PYTHON_VERSION_HARD:
|
||||
print(
|
||||
"repo: error: Python 3 version is too old; "
|
||||
"Please use Python {}.{} or newer.".format(
|
||||
@ -170,7 +150,7 @@ if not REPO_REV:
|
||||
BUG_URL = "https://issues.gerritcodereview.com/issues/new?component=1370071"
|
||||
|
||||
# increment this whenever we make important changes to this script
|
||||
VERSION = (2, 39)
|
||||
VERSION = (2, 40)
|
||||
|
||||
# increment this if the MAINTAINER_KEYS block is modified
|
||||
KEYRING_VERSION = (2, 3)
|
||||
@ -274,19 +254,8 @@ import optparse
|
||||
import re
|
||||
import shutil
|
||||
import stat
|
||||
|
||||
|
||||
if sys.version_info[0] == 3:
|
||||
import urllib.error
|
||||
import urllib.request
|
||||
else:
|
||||
import imp
|
||||
|
||||
import urllib2
|
||||
|
||||
urllib = imp.new_module("urllib")
|
||||
urllib.request = urllib2
|
||||
urllib.error = urllib2
|
||||
import urllib.error
|
||||
import urllib.request
|
||||
|
||||
|
||||
repo_config_dir = os.getenv("REPO_CONFIG_DIR", os.path.expanduser("~"))
|
||||
|
Loading…
Reference in New Issue
Block a user