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/YACC | |
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/YACC')
-rw-r--r-- | test/YACC/YACC.py | 3 | ||||
-rw-r--r-- | test/YACC/YACCCOM.py | 2 | ||||
-rw-r--r-- | test/YACC/YACCCOMSTR.py | 2 | ||||
-rw-r--r-- | test/YACC/YACCFLAGS.py | 5 | ||||
-rw-r--r-- | test/YACC/YACCHFILESUFFIX.py | 5 | ||||
-rw-r--r-- | test/YACC/YACCHXXFILESUFFIX.py | 5 | ||||
-rw-r--r-- | test/YACC/YACCVCGFILESUFFIX.py | 5 | ||||
-rw-r--r-- | test/YACC/live.py | 7 |
8 files changed, 13 insertions, 21 deletions
diff --git a/test/YACC/YACC.py b/test/YACC/YACC.py index a9ef57c..59067f3 100644 --- a/test/YACC/YACC.py +++ b/test/YACC/YACC.py @@ -45,7 +45,6 @@ test = TestSCons.TestSCons() test.write('myyacc.py', """ import getopt -import string import sys cmd_opts, args = getopt.getopt(sys.argv[1:], 'o:', []) output = None @@ -55,7 +54,7 @@ for opt, arg in cmd_opts: else: opt_string = opt_string + ' ' + opt for a in args: contents = open(a, 'rb').read() - output.write(string.replace(contents, 'YACC', 'myyacc.py')) + output.write(contents.replace('YACC', 'myyacc.py')) output.close() sys.exit(0) """) diff --git a/test/YACC/YACCCOM.py b/test/YACC/YACCCOM.py index 14c4f01..4e43676 100644 --- a/test/YACC/YACCCOM.py +++ b/test/YACC/YACCCOM.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 != '/*yacc*/\\n', infile.readlines()): + for l in [l for l in infile.readlines() if l != '/*yacc*/\\n']: outfile.write(l) sys.exit(0) """) diff --git a/test/YACC/YACCCOMSTR.py b/test/YACC/YACCCOMSTR.py index f920440..eaf3fde 100644 --- a/test/YACC/YACCCOMSTR.py +++ b/test/YACC/YACCCOMSTR.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 != '/*yacc*/\\n', infile.readlines()): + for l in [l for l in infile.readlines() if l != '/*yacc*/\\n']: outfile.write(l) sys.exit(0) """) diff --git a/test/YACC/YACCFLAGS.py b/test/YACC/YACCFLAGS.py index f36cb94..f0b698b 100644 --- a/test/YACC/YACCFLAGS.py +++ b/test/YACC/YACCFLAGS.py @@ -47,7 +47,6 @@ test.subdir('in') test.write('myyacc.py', """ import getopt -import string import sys cmd_opts, args = getopt.getopt(sys.argv[1:], 'o:I:x', []) output = None @@ -59,8 +58,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, 'YACCFLAGS', opt_string) - contents = string.replace(contents, 'I_ARGS', i_arguments) + contents = contents.replace('YACCFLAGS', opt_string) + contents = contents.replace('I_ARGS', i_arguments) output.write(contents) output.close() sys.exit(0) diff --git a/test/YACC/YACCHFILESUFFIX.py b/test/YACC/YACCHFILESUFFIX.py index ee554b6..8801aea 100644 --- a/test/YACC/YACCHFILESUFFIX.py +++ b/test/YACC/YACCHFILESUFFIX.py @@ -40,7 +40,6 @@ test = TestSCons.TestSCons() test.write('myyacc.py', """\ import getopt import os.path -import string import sys opts, args = getopt.getopt(sys.argv[1:], 'do:') for o, a in opts: @@ -48,11 +47,11 @@ for o, a in opts: outfile = open(a, 'wb') for f in args: infile = open(f, 'rb') - for l in filter(lambda l: l != '/*yacc*/\\n', infile.readlines()): + for l in [l for l in infile.readlines() if l != '/*yacc*/\\n']: outfile.write(l) outfile.close() base, ext = os.path.splitext(args[0]) -open(base+'.hsuffix', 'wb').write(string.join(sys.argv)+'\\n') +open(base+'.hsuffix', 'wb').write(" ".join(sys.argv)+'\\n') sys.exit(0) """) diff --git a/test/YACC/YACCHXXFILESUFFIX.py b/test/YACC/YACCHXXFILESUFFIX.py index 933fbc5..6664356 100644 --- a/test/YACC/YACCHXXFILESUFFIX.py +++ b/test/YACC/YACCHXXFILESUFFIX.py @@ -40,7 +40,6 @@ test = TestSCons.TestSCons() test.write('myyacc.py', """\ import getopt import os.path -import string import sys opts, args = getopt.getopt(sys.argv[1:], 'do:') for o, a in opts: @@ -48,11 +47,11 @@ for o, a in opts: outfile = open(a, 'wb') for f in args: infile = open(f, 'rb') - for l in filter(lambda l: l != '/*yacc*/\\n', infile.readlines()): + for l in [l for l in infile.readlines() if l != '/*yacc*/\\n']: outfile.write(l) outfile.close() base, ext = os.path.splitext(args[0]) -open(base+'.hxxsuffix', 'wb').write(string.join(sys.argv)+'\\n') +open(base+'.hxxsuffix', 'wb').write(" ".join(sys.argv)+'\\n') sys.exit(0) """) diff --git a/test/YACC/YACCVCGFILESUFFIX.py b/test/YACC/YACCVCGFILESUFFIX.py index 655cc44..0327d8a 100644 --- a/test/YACC/YACCVCGFILESUFFIX.py +++ b/test/YACC/YACCVCGFILESUFFIX.py @@ -39,7 +39,6 @@ test = TestSCons.TestSCons() test.write('myyacc.py', """\ import getopt import os.path -import string import sys vcg = None opts, args = getopt.getopt(sys.argv[1:], 'go:') @@ -50,12 +49,12 @@ for o, a in opts: outfile = open(a, 'wb') for f in args: infile = open(f, 'rb') - for l in filter(lambda l: l != '/*yacc*/\\n', infile.readlines()): + for l in [l for l in infile.readlines() if l != '/*yacc*/\\n']: outfile.write(l) outfile.close() if vcg: base, ext = os.path.splitext(args[0]) - open(base+'.vcgsuffix', 'wb').write(string.join(sys.argv)+'\\n') + open(base+'.vcgsuffix', 'wb').write(" ".join(sys.argv)+'\\n') sys.exit(0) """) diff --git a/test/YACC/live.py b/test/YACC/live.py index 4922c6a..28e2186 100644 --- a/test/YACC/live.py +++ b/test/YACC/live.py @@ -28,8 +28,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" Test YACC and YACCFLAGS with a live yacc compiler. """ -import string - import TestSCons _exe = TestSCons._exe @@ -44,11 +42,10 @@ if not yacc: 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(YACCFLAGS='-d') |