Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
repo: Remove unreachable code.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
jaraco authored and LUCI committed Nov 1, 2023
1 parent b32ccbb commit d32b2dc
Showing 1 changed file with 4 additions and 35 deletions.
39 changes: 4 additions & 35 deletions repo
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand All @@ -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)
Expand Down Expand Up @@ -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("~"))
Expand Down

0 comments on commit d32b2dc

Please sign in to comment.