summaryrefslogtreecommitdiffstats
path: root/test/ZIP
diff options
context:
space:
mode:
Diffstat (limited to 'test/ZIP')
-rw-r--r--test/ZIP/ZIP.py11
-rw-r--r--test/ZIP/ZIPCOM.py2
-rw-r--r--test/ZIP/ZIPCOMSTR.py2
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)
""")