diff options
Diffstat (limited to 'test/M4')
-rw-r--r-- | test/M4/M4.py | 9 | ||||
-rw-r--r-- | test/M4/M4COM.py | 2 | ||||
-rw-r--r-- | test/M4/M4COMSTR.py | 2 |
3 files changed, 5 insertions, 8 deletions
diff --git a/test/M4/M4.py b/test/M4/M4.py index 44cda7c..6c2de9c 100644 --- a/test/M4/M4.py +++ b/test/M4/M4.py @@ -29,7 +29,6 @@ Test that $M4 and $M4FLAGS work as expected. """ import os -import string import TestSCons @@ -40,10 +39,9 @@ test = TestSCons.TestSCons() test.write('mym4.py', """ -import string import sys contents = sys.stdin.read() -sys.stdout.write(string.replace(contents, 'M4', 'mym4.py')) +sys.stdout.write(contents.replace('M4', 'mym4.py')) sys.exit(0) """) @@ -71,11 +69,10 @@ if m4: test.write("wrapper.py", """import os -import string import sys open('%s', 'wb').write("wrapper.py\\n") -os.system(string.join(sys.argv[1:], " ")) -""" % string.replace(test.workpath('wrapper.out'), '\\', '\\\\')) +os.system(" ".join(sys.argv[1:])) +""" % test.workpath('wrapper.out').replace('\\', '\\\\')) test.write('SConstruct', """ foo = Environment(tools=['default', 'm4'], diff --git a/test/M4/M4COM.py b/test/M4/M4COM.py index 9299645..ad15172 100644 --- a/test/M4/M4COM.py +++ b/test/M4/M4COM.py @@ -41,7 +41,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 != '/*m4*/\\n', infile.readlines()): + for l in [l for l in infile.readlines() if l != '/*m4*/\\n']: outfile.write(l) sys.exit(0) """) diff --git a/test/M4/M4COMSTR.py b/test/M4/M4COMSTR.py index 1425f5c..1b5bd35 100644 --- a/test/M4/M4COMSTR.py +++ b/test/M4/M4COMSTR.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 != '/*m4*/\\n', infile.readlines()): + for l in [l for l in infile.readlines() if l != '/*m4*/\\n']: outfile.write(l) sys.exit(0) """) |