diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-01-09 08:25:47 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-01-09 08:25:48 -0800 |
commit | 48b7f524550ad46db95ec097e7f085160073a247 (patch) | |
tree | f46c13a0011afb2bd659011076721b1dc0cb154a /contrib | |
parent | 00f1a867b4dde5065a579286a4de880142548bb2 (diff) | |
parent | a33faf2827bfc7baea5d83ef1be8fe659a963355 (diff) | |
download | git-48b7f524550ad46db95ec097e7f085160073a247.tar.gz |
Merge branch 'er/python-version-requirements'
Some python scripts we ship cannot be run with older versions of the
interpreter.
* er/python-version-requirements:
Add checks to Python scripts for version dependencies.
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/ciabot/ciabot.py | 8 | ||||
-rwxr-xr-x | contrib/fast-import/import-zips.py | 7 | ||||
-rwxr-xr-x | contrib/hg-to-git/hg-to-git.py | 5 | ||||
-rw-r--r-- | contrib/p4import/git-p4import.py | 5 | ||||
-rwxr-xr-x | contrib/svn-fe/svnrdump_sim.py | 4 |
5 files changed, 27 insertions, 2 deletions
diff --git a/contrib/ciabot/ciabot.py b/contrib/ciabot/ciabot.py index bd24395d4c..36b5665ff8 100755 --- a/contrib/ciabot/ciabot.py +++ b/contrib/ciabot/ciabot.py @@ -47,7 +47,13 @@ # we default to that. # -import os, sys, commands, socket, urllib +import sys +if sys.hexversion < 0x02000000: + # The limiter is the xml.sax module + sys.stderr.write("ciabot.py: requires Python 2.0.0 or later.\n") + sys.exit(1) + +import os, commands, socket, urllib from xml.sax.saxutils import escape # Changeset URL prefix for your repo: when the commit ID is appended diff --git a/contrib/fast-import/import-zips.py b/contrib/fast-import/import-zips.py index 82f5ed3ddc..5cec9b0129 100755 --- a/contrib/fast-import/import-zips.py +++ b/contrib/fast-import/import-zips.py @@ -9,10 +9,15 @@ ## git log --stat import-zips from os import popen, path -from sys import argv, exit +from sys import argv, exit, hexversion, stderr from time import mktime from zipfile import ZipFile +if hexversion < 0x01060000: + # The limiter is the zipfile module + sys.stderr.write("import-zips.py: requires Python 1.6.0 or later.\n") + sys.exit(1) + if len(argv) < 2: print 'Usage:', argv[0], '<zipfile>...' exit(1) diff --git a/contrib/hg-to-git/hg-to-git.py b/contrib/hg-to-git/hg-to-git.py index 046cb2b268..232625a7b7 100755 --- a/contrib/hg-to-git/hg-to-git.py +++ b/contrib/hg-to-git/hg-to-git.py @@ -23,6 +23,11 @@ import os, os.path, sys import tempfile, pickle, getopt import re +if sys.hexversion < 0x02030000: + # The behavior of the pickle module changed significantly in 2.3 + sys.stderr.write("hg-to-git.py: requires Python 2.3 or later.\n") + sys.exit(1) + # Maps hg version -> git version hgvers = {} # List of children for each hg revision diff --git a/contrib/p4import/git-p4import.py b/contrib/p4import/git-p4import.py index b6e534b65b..593d6a0682 100644 --- a/contrib/p4import/git-p4import.py +++ b/contrib/p4import/git-p4import.py @@ -14,6 +14,11 @@ import sys import time import getopt +if sys.hexversion < 0x02020000: + # The behavior of the marshal module changed significantly in 2.2 + sys.stderr.write("git-p4import.py: requires Python 2.2 or later.\n") + sys.exit(1) + from signal import signal, \ SIGPIPE, SIGINT, SIG_DFL, \ default_int_handler diff --git a/contrib/svn-fe/svnrdump_sim.py b/contrib/svn-fe/svnrdump_sim.py index 1cfac4a6f8..17cf6f961f 100755 --- a/contrib/svn-fe/svnrdump_sim.py +++ b/contrib/svn-fe/svnrdump_sim.py @@ -7,6 +7,10 @@ to the highest revision that should be available. """ import sys, os +if sys.hexversion < 0x02040000: + # The limiter is the ValueError() calls. This may be too conservative + sys.stderr.write("svnrdump-sim.py: requires Python 2.4 or later.\n") + sys.exit(1) def getrevlimit(): var = 'SVNRMAX' |