summaryrefslogtreecommitdiff
path: root/test/VariantDir
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2017-03-12 23:33:00 -0400
committerWilliam Deegan <bill@baddogconsulting.com>2017-03-12 23:33:00 -0400
commite54039fdd8675b7147293d5c1233e9c8982673a1 (patch)
tree6b6a57d75f4be82a5864af9fe11af51bd0769b7e /test/VariantDir
parente9697930e73c81fcad8f937a99a3d4aab766a28e (diff)
downloadscons-e54039fdd8675b7147293d5c1233e9c8982673a1.tar.gz
py2/3 byte fixes
Diffstat (limited to 'test/VariantDir')
-rw-r--r--test/VariantDir/Clean.py4
-rw-r--r--test/VariantDir/File-create.py4
-rw-r--r--test/VariantDir/errors.py6
3 files changed, 7 insertions, 7 deletions
diff --git a/test/VariantDir/Clean.py b/test/VariantDir/Clean.py
index d1e0bb84..b2e93a33 100644
--- a/test/VariantDir/Clean.py
+++ b/test/VariantDir/Clean.py
@@ -43,8 +43,8 @@ VariantDir('build1', '.', duplicate=1)
def build_sample(target, source, env):
targetdir = str(target[0].dir)
target = str(target[0])
- open(target, 'wb').write(open(str(source[0]), 'rb').read())
- open(targetdir+'/sample.junk', 'wb').write('Side effect!\\n')
+ open(target, 'w').write(open(str(source[0]), 'r').read())
+ open(targetdir+'/sample.junk', 'w').write('Side effect!\\n')
t0 = Command("build0/sample.out", "sample.in", build_sample)
t1 = Command("build1/sample.out", "sample.in", build_sample)
diff --git a/test/VariantDir/File-create.py b/test/VariantDir/File-create.py
index 725404ce..50db618e 100644
--- a/test/VariantDir/File-create.py
+++ b/test/VariantDir/File-create.py
@@ -49,12 +49,12 @@ SConscript('src/SConscript', variant_dir='build1', chdir=1, duplicate=1)
test.write(['src', 'SConscript'], """\
#f1_in = File('f1.in')
#Command('f1.out', f1_in, Copy('$TARGET', '$SOURCE'))
-#open('f1.in', 'wb').write("f1.in\\n")
+#open('f1.in', 'w').write("f1.in\\n")
f2_in = File('f2.in')
str(f2_in)
Command('f2.out', f2_in, Copy('$TARGET', '$SOURCE'))
-open('f2.in', 'wb').write("f2.in\\n")
+open('f2.in', 'w').write("f2.in\\n")
""")
test.run(arguments = '--tree=all .')
diff --git a/test/VariantDir/errors.py b/test/VariantDir/errors.py
index d1490d42..c74d1037 100644
--- a/test/VariantDir/errors.py
+++ b/test/VariantDir/errors.py
@@ -57,9 +57,9 @@ def fake_scan(node, env, target):
def cat(env, source, target):
target = str(target[0])
- f = open(target, "wb")
+ f = open(target, "w")
for src in source:
- f.write(open(str(src), "rb").read())
+ f.write(open(str(src), "r").read())
f.close()
env = Environment(BUILDERS={'Build':Builder(action=cat)},
@@ -77,7 +77,7 @@ env.Build('file.out', 'file.in')
# Just verify that the normal case works fine.
test.run(chdir = 'normal', arguments = ".")
-test.fail_test(test.read(['normal', 'build', 'file.out']) != "normal/src/file.in\n")
+test.must_match(['normal', 'build', 'file.out'], "normal/src/file.in\n", mode='r')
# Verify the error when the VariantDir itself is read-only. Don't bother
# to test this on Windows, because the ACL (I think) still allows the