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/LEX | |
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/LEX')
-rw-r--r-- | test/LEX/LEX.py | 3 | ||||
-rw-r--r-- | test/LEX/LEXCOM.py | 2 | ||||
-rw-r--r-- | test/LEX/LEXCOMSTR.py | 2 | ||||
-rw-r--r-- | test/LEX/LEXFLAGS.py | 5 | ||||
-rw-r--r-- | test/LEX/live.py | 7 |
5 files changed, 7 insertions, 12 deletions
diff --git a/test/LEX/LEX.py b/test/LEX/LEX.py index 0ead71a..975d4e9 100644 --- a/test/LEX/LEX.py +++ b/test/LEX/LEX.py @@ -37,12 +37,11 @@ test = TestSCons.TestSCons() test.write('mylex.py', """ import getopt -import string import sys cmd_opts, args = getopt.getopt(sys.argv[1:], 't', []) for a in args: contents = open(a, 'rb').read() - sys.stdout.write(string.replace(contents, 'LEX', 'mylex.py')) + sys.stdout.write(contents.replace('LEX', 'mylex.py')) sys.exit(0) """) diff --git a/test/LEX/LEXCOM.py b/test/LEX/LEXCOM.py index f496f95..5fb82fe 100644 --- a/test/LEX/LEXCOM.py +++ b/test/LEX/LEXCOM.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 != '/*lex*/\\n', infile.readlines()): + for l in [l for l in infile.readlines() if l != '/*lex*/\\n']: outfile.write(l) sys.exit(0) """) diff --git a/test/LEX/LEXCOMSTR.py b/test/LEX/LEXCOMSTR.py index fa0bbf1..83b2f9c 100644 --- a/test/LEX/LEXCOMSTR.py +++ b/test/LEX/LEXCOMSTR.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 != '/*lex*/\\n', infile.readlines()): + for l in [l for l in infile.readlines() if l != '/*lex*/\\n']: outfile.write(l) sys.exit(0) """) diff --git a/test/LEX/LEXFLAGS.py b/test/LEX/LEXFLAGS.py index aaabdf0..82ae586 100644 --- a/test/LEX/LEXFLAGS.py +++ b/test/LEX/LEXFLAGS.py @@ -39,7 +39,6 @@ test.subdir('in') test.write('mylex.py', """ import getopt -import string import sys cmd_opts, args = getopt.getopt(sys.argv[1:], 'I:tx', []) opt_string = '' @@ -49,8 +48,8 @@ for opt, arg in cmd_opts: else: opt_string = opt_string + ' ' + opt for a in args: contents = open(a, 'rb').read() - contents = string.replace(contents, 'LEXFLAGS', opt_string) - contents = string.replace(contents, 'I_ARGS', i_arguments) + contents = contents.replace('LEXFLAGS', opt_string) + contents = contents.replace('I_ARGS', i_arguments) sys.stdout.write(contents) sys.exit(0) """) diff --git a/test/LEX/live.py b/test/LEX/live.py index da51175..f50b06f 100644 --- a/test/LEX/live.py +++ b/test/LEX/live.py @@ -28,8 +28,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" Test LEX and LEXFLAGS with a live lex. """ -import string - import TestSCons _exe = TestSCons._exe @@ -45,11 +43,10 @@ if not lex: 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() |