diff options
author | Greg Noel <GregNoel@tigris.org> | 2010-03-25 04:14:28 (GMT) |
---|---|---|
committer | Greg Noel <GregNoel@tigris.org> | 2010-03-25 04:14:28 (GMT) |
commit | 22d352500f1cd6bd0c53d788a5dc44a1fefa676e (patch) | |
tree | 0984fd581082c27cfbfbb7f94d5751b0e6fd2741 /test/ZIP | |
parent | 75ac32ac8e32076e25b72a19eb56340cc585fa4e (diff) | |
download | SCons-22d352500f1cd6bd0c53d788a5dc44a1fefa676e.zip SCons-22d352500f1cd6bd0c53d788a5dc44a1fefa676e.tar.gz SCons-22d352500f1cd6bd0c53d788a5dc44a1fefa676e.tar.bz2 |
Move 2.0 changes collected in branches/pending back to trunk for further
development. Note that this set of changes is NOT backward-compatible;
the trunk no longer works with Python 1.5.2, 2.0, or 2.1.
Diffstat (limited to 'test/ZIP')
-rw-r--r-- | test/ZIP/ZIP.py | 11 | ||||
-rw-r--r-- | test/ZIP/ZIPCOM.py | 2 | ||||
-rw-r--r-- | test/ZIP/ZIPCOMSTR.py | 2 |
3 files changed, 7 insertions, 8 deletions
diff --git a/test/ZIP/ZIP.py b/test/ZIP/ZIP.py index 60f3dad..73e7810 100644 --- a/test/ZIP/ZIP.py +++ b/test/ZIP/ZIP.py @@ -26,7 +26,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import os import stat -import string import TestSCons @@ -95,7 +94,7 @@ try: def files(fname): zf = zipfile.ZipFile(fname, 'r') - return map(lambda x: x.filename, zf.infolist()) + return [x.filename for x in zf.infolist()] except ImportError: internal_zip = 0 @@ -104,14 +103,14 @@ except ImportError: def files(fname, test=test, unzip=unzip): test.run(program = unzip, arguments = "-l -qq %s" % fname) - lines = string.split(test.stdout(), "\n")[:-1] + lines = test.stdout().split("\n")[:-1] def lastword(line): - return string.split(line)[-1] - return map(lastword, lines) + return line.split()[-1] + return list(map(lastword, lines)) if zip: - marker_out = string.replace(test.workpath('marker.out'), '\\', '\\\\') + marker_out = test.workpath('marker.out').replace('\\', '\\\\') test.write('SConstruct', """\ def marker(target, source, env): diff --git a/test/ZIP/ZIPCOM.py b/test/ZIP/ZIPCOM.py index 6c78824..e982c58 100644 --- a/test/ZIP/ZIPCOM.py +++ b/test/ZIP/ZIPCOM.py @@ -40,7 +40,7 @@ test.write('myzip.py', r""" import sys outfile = open(sys.argv[1], 'wb') infile = open(sys.argv[2], 'rb') -for l in filter(lambda l: l != '/*zip*/\n', infile.readlines()): +for l in [l for l in infile.readlines() if l != '/*zip*/\n']: outfile.write(l) sys.exit(0) """) diff --git a/test/ZIP/ZIPCOMSTR.py b/test/ZIP/ZIPCOMSTR.py index acc77c7..d91a48d 100644 --- a/test/ZIP/ZIPCOMSTR.py +++ b/test/ZIP/ZIPCOMSTR.py @@ -42,7 +42,7 @@ import sys outfile = open(sys.argv[1], 'wb') for f in sys.argv[2:]: infile = open(f, 'rb') - for l in filter(lambda l: l != '/*zip*/\\n', infile.readlines()): + for l in [l for l in infile.readlines() if l != '/*zip*/\\n']: outfile.write(l) sys.exit(0) """) |