summaryrefslogtreecommitdiff
path: root/test/redirection.py
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2017-03-24 14:55:07 -0700
committerWilliam Deegan <bill@baddogconsulting.com>2017-03-24 14:55:07 -0700
commitd099888c2be6d65870987c70eace995d7e34241b (patch)
treead47b56bdf48d6e19f3c7d5edb274fc92c40fb49 /test/redirection.py
parent2e593b9d2b58f34ef34b1b56bb13945849950112 (diff)
downloadscons-d099888c2be6d65870987c70eace995d7e34241b.tar.gz
fix py2/3. Also fix py2 win32 broken tests
Diffstat (limited to 'test/redirection.py')
-rw-r--r--test/redirection.py17
1 files changed, 6 insertions, 11 deletions
diff --git a/test/redirection.py b/test/redirection.py
index cc8ebf92..ffc76b5f 100644
--- a/test/redirection.py
+++ b/test/redirection.py
@@ -33,15 +33,10 @@ test = TestSCons.TestSCons()
test.write('cat.py', r"""
import sys
try:
- input = open(sys.argv[1], 'rb').read()
- try:
- sys.stdout.buffer.write(input)
- except AttributeError:
- sys.stdout.write(input)
+ input = open(sys.argv[1], 'r').read()
except IndexError:
input = sys.stdin.read()
- sys.stdout.write(input)
-
+sys.stdout.write(input)
sys.exit(0)
""")
@@ -57,10 +52,10 @@ env.Command(target='foo4', source='bar4',
action=r'%(_python_)s cat.py <$SOURCES |%(_python_)s cat.py >$TARGET')
""" % locals())
-test.write('bar1', 'bar1\r\n', mode='w')
-test.write('bar2', 'bar2\r\n', mode='w')
-test.write('bar3', 'bar3\r\n', mode='w')
-test.write('bar4', 'bar4\r\n', mode='w')
+test.write('bar1', 'bar1\r\n')
+test.write('bar2', 'bar2\r\n')
+test.write('bar3', 'bar3\r\n')
+test.write('bar4', 'bar4\r\n')
test.run(arguments='.')