summaryrefslogtreecommitdiff
path: root/test/YACC
diff options
context:
space:
mode:
authorGreg Noel <GregNoel@tigris.org>2010-03-25 04:14:28 +0000
committerGreg Noel <GregNoel@tigris.org>2010-03-25 04:14:28 +0000
commitaf6d7c35464bb75dcabc72094b4bd84154dde50d (patch)
tree0984fd581082c27cfbfbb7f94d5751b0e6fd2741 /test/YACC
parent55ef7fe83e3211be3045f089767ca8e198db1c2c (diff)
downloadscons-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/YACC')
-rw-r--r--test/YACC/YACC.py3
-rw-r--r--test/YACC/YACCCOM.py2
-rw-r--r--test/YACC/YACCCOMSTR.py2
-rw-r--r--test/YACC/YACCFLAGS.py5
-rw-r--r--test/YACC/YACCHFILESUFFIX.py5
-rw-r--r--test/YACC/YACCHXXFILESUFFIX.py5
-rw-r--r--test/YACC/YACCVCGFILESUFFIX.py5
-rw-r--r--test/YACC/live.py7
8 files changed, 13 insertions, 21 deletions
diff --git a/test/YACC/YACC.py b/test/YACC/YACC.py
index a9ef57cb..59067f31 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 14c4f010..4e43676d 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 f9204401..eaf3fded 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 f36cb944..f0b698bf 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 ee554b6b..8801aea7 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 933fbc50..6664356e 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 655cc443..0327d8a2 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 4922c6a7..28e2186d 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')