summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2017-02-28 00:09:58 (GMT)
committerWilliam Deegan <bill@baddogconsulting.com>2017-02-28 00:09:58 (GMT)
commit7605860fff6a4d27b4bfc47bbe589e682b7e3d80 (patch)
tree6d643b8825430c1e25d1baeff533ffbace5fb95a /test
parent90f6531cd593597ba7a1ccc2a5050bf9394b54a2 (diff)
downloadSCons-7605860fff6a4d27b4bfc47bbe589e682b7e3d80.zip
SCons-7605860fff6a4d27b4bfc47bbe589e682b7e3d80.tar.gz
SCons-7605860fff6a4d27b4bfc47bbe589e682b7e3d80.tar.bz2
fix byte file reading issues for py3/2 port
Diffstat (limited to 'test')
-rw-r--r--test/AS/ASFLAGS.py5
-rw-r--r--test/AS/ASPP.py12
-rw-r--r--test/AS/ASPPFLAGS.py12
3 files changed, 14 insertions, 15 deletions
diff --git a/test/AS/ASFLAGS.py b/test/AS/ASFLAGS.py
index 553ea67..56eb11b 100644
--- a/test/AS/ASFLAGS.py
+++ b/test/AS/ASFLAGS.py
@@ -58,7 +58,7 @@ while args:
infile = open(args[0], 'rb')
outfile = open(out, 'wb')
for l in infile.readlines():
- if l[:5] != '#link':
+ if l[:5] != b'#link':
outfile.write(l)
sys.exit(0)
""")
@@ -89,8 +89,7 @@ infile = open(inf, 'rb')
outfile = open(out, 'wb')
outfile.write(optstring + "\n")
for l in infile.readlines():
- print("LINE->%s<-"%l)
- if l[:3] != bytearray('#as'):
+ if l[:3] != b'#as':
outfile.write(l)
sys.exit(0)
""")
diff --git a/test/AS/ASPP.py b/test/AS/ASPP.py
index 67f4071..22cc36a 100644
--- a/test/AS/ASPP.py
+++ b/test/AS/ASPP.py
@@ -53,7 +53,7 @@ while args:
infile = open(args[0], 'rb')
outfile = open(out, 'wb')
for l in infile.readlines():
- if l[:5] != '#link':
+ if l[:5] != b'#link':
outfile.write(l)
sys.exit(0)
""")
@@ -77,7 +77,7 @@ while args:
infile = open(inf, 'rb')
outfile = open(out, 'wb')
for l in infile.readlines():
- if l[:3] != '#as':
+ if l[:3] != b'#as':
outfile.write(l)
sys.exit(0)
""")
@@ -93,7 +93,7 @@ for opt, arg in opts:
infile = open(args[0], 'rb')
outfile = open(out, 'wb')
for l in infile.readlines():
- if l[:5] != '#link':
+ if l[:5] != b'#link':
outfile.write(l)
sys.exit(0)
""")
@@ -107,7 +107,7 @@ for opt, arg in opts:
infile = open(args[0], 'rb')
outfile = open(out, 'wb')
for l in infile.readlines():
- if l[:3] != '#as':
+ if l[:3] != b'#as':
outfile.write(l)
sys.exit(0)
""")
@@ -143,9 +143,9 @@ test.write('test3.sx', r"""This is a .sx file.
test.run(arguments = '.', stderr = None)
-test.fail_test(test.read('test1' + _exe) != "This is a .spp file.\n")
+test.fail_test(test.read('test1' + _exe) != b"This is a .spp file.\n")
-test.fail_test(test.read('test2' + _exe) != "This is a .SPP file.\n")
+test.fail_test(test.read('test2' + _exe) != b"This is a .SPP file.\n")
# Ensure the source scanner was run on test3.sx by
# checking for foo.h in the dependency tree output
diff --git a/test/AS/ASPPFLAGS.py b/test/AS/ASPPFLAGS.py
index 731413e..460cfcb 100644
--- a/test/AS/ASPPFLAGS.py
+++ b/test/AS/ASPPFLAGS.py
@@ -58,7 +58,7 @@ while args:
infile = open(args[0], 'rb')
outfile = open(out, 'wb')
for l in infile.readlines():
- if l[:5] != '#link':
+ if l[:5] != b'#link':
outfile.write(l)
sys.exit(0)
""")
@@ -87,9 +87,9 @@ while args:
optstring = optstring + ' ' + a
infile = open(inf, 'rb')
outfile = open(out, 'wb')
-outfile.write(optstring + "\n")
+outfile.write(bytearray(optstring + "\n",'utf-8'))
for l in infile.readlines():
- if l[:3] != '#as':
+ if l[:3] != b'#as':
outfile.write(l)
sys.exit(0)
""")
@@ -109,7 +109,7 @@ for opt, arg in opts:
infile = open(args[0], 'rb')
outfile = open(out, 'wb')
for l in infile.readlines():
- if l[:5] != '#link':
+ if l[:5] != b'#link':
outfile.write(l)
sys.exit(0)
""")
@@ -124,9 +124,9 @@ for opt, arg in opts:
else: optstring = optstring + ' ' + opt
infile = open(args[0], 'rb')
outfile = open(out, 'wb')
-outfile.write(optstring + "\n")
+outfile.write(bytearray(optstring + "\n",'utf-8'))
for l in infile.readlines():
- if l[:3] != '#as':
+ if l[:3] != b'#as':
outfile.write(l)
sys.exit(0)
""")