summaryrefslogtreecommitdiff
path: root/test/LEX
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/LEX
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/LEX')
-rw-r--r--test/LEX/LEX.py3
-rw-r--r--test/LEX/LEXCOM.py2
-rw-r--r--test/LEX/LEXCOMSTR.py2
-rw-r--r--test/LEX/LEXFLAGS.py5
-rw-r--r--test/LEX/live.py7
5 files changed, 7 insertions, 12 deletions
diff --git a/test/LEX/LEX.py b/test/LEX/LEX.py
index 0ead71ac..975d4e9c 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 f496f951..5fb82fed 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 fa0bbf19..83b2f9c0 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 aaabdf04..82ae5865 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 da511753..f50b06f3 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()