diff options
author | Greg Noel <GregNoel@tigris.org> | 2010-03-25 04:14:28 +0000 |
---|---|---|
committer | Greg Noel <GregNoel@tigris.org> | 2010-03-25 04:14:28 +0000 |
commit | af6d7c35464bb75dcabc72094b4bd84154dde50d (patch) | |
tree | 0984fd581082c27cfbfbb7f94d5751b0e6fd2741 /test/ZIP | |
parent | 55ef7fe83e3211be3045f089767ca8e198db1c2c (diff) | |
download | scons-af6d7c35464bb75dcabc72094b4bd84154dde50d.tar.gz |
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 60f3dad1..73e78105 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 6c78824e..e982c58c 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 acc77c71..d91a48d4 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) """) |