summaryrefslogtreecommitdiff
path: root/git-p4.py
diff options
context:
space:
mode:
authorYang Zhao <yang.zhao@skyboxlabs.com>2019-12-13 23:52:35 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-01-15 20:53:39 (GMT)
commit0b4396f0688f6c82ada83eab68b1c8dd3669d8bf (patch)
tree499a6a09945d1cbdb520af2843620ff5cd17e4e1 /git-p4.py
parent559c6fc317f92a0a3994f816d3513cd322745852 (diff)
downloadgit-0b4396f0688f6c82ada83eab68b1c8dd3669d8bf.zip
git-0b4396f0688f6c82ada83eab68b1c8dd3669d8bf.tar.gz
git-0b4396f0688f6c82ada83eab68b1c8dd3669d8bf.tar.bz2
git-p4: make python2.7 the oldest supported version
Python2.6 and earlier have been end-of-life'd for many years now, and we actually already use 2.7-only features in the code. Make the version check reflect current realities. This also removes the need to explicitly define CalledProcessError if it's not available. Signed-off-by: Yang Zhao <yang.zhao@skyboxlabs.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-p4.py')
-rwxr-xr-xgit-p4.py20
1 files changed, 2 insertions, 18 deletions
diff --git a/git-p4.py b/git-p4.py
index 60c73b6..37777bb 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -8,9 +8,8 @@
# License: MIT <http://www.opensource.org/licenses/mit-license.php>
#
import sys
-if sys.hexversion < 0x02040000:
- # The limiter is the subprocess module
- sys.stderr.write("git-p4: requires Python 2.4 or later.\n")
+if sys.version_info.major < 3 and sys.version_info.minor < 7:
+ sys.stderr.write("git-p4: requires Python 2.7 or later.\n")
sys.exit(1)
import os
import optparse
@@ -43,21 +42,6 @@ else:
bytes = str
basestring = basestring
-try:
- from subprocess import CalledProcessError
-except ImportError:
- # from python2.7:subprocess.py
- # Exception classes used by this module.
- class CalledProcessError(Exception):
- """This exception is raised when a process run by check_call() returns
- a non-zero exit status. The exit status will be stored in the
- returncode attribute."""
- def __init__(self, returncode, cmd):
- self.returncode = returncode
- self.cmd = cmd
- def __str__(self):
- return "Command '%s' returned non-zero exit status %d" % (self.cmd, self.returncode)
-
verbose = False
# Only labels/tags matching this will be imported/exported