Add checks to Python scripts for version dependencies.

Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Eric S. Raymond
2012-12-28 11:40:59 -05:00
committed by Junio C Hamano
parent 18499ba694
commit a33faf2827
8 changed files with 44 additions and 3 deletions

View File

@@ -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)