diff options
author | William Deegan <bill@baddogconsulting.com> | 2017-02-27 16:09:58 -0800 |
---|---|---|
committer | William Deegan <bill@baddogconsulting.com> | 2017-02-27 16:09:58 -0800 |
commit | d5443dc32e93f33c2e4d7ed307f5c786193b57b7 (patch) | |
tree | 6d643b8825430c1e25d1baeff533ffbace5fb95a /test/AS | |
parent | dcb3b6d802f409fd20866f60722d8b85fcef5056 (diff) | |
download | scons-d5443dc32e93f33c2e4d7ed307f5c786193b57b7.tar.gz |
fix byte file reading issues for py3/2 port
Diffstat (limited to 'test/AS')
-rw-r--r-- | test/AS/ASFLAGS.py | 5 | ||||
-rw-r--r-- | test/AS/ASPP.py | 12 | ||||
-rw-r--r-- | test/AS/ASPPFLAGS.py | 12 |
3 files changed, 14 insertions, 15 deletions
diff --git a/test/AS/ASFLAGS.py b/test/AS/ASFLAGS.py index 553ea67a..56eb11bb 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 67f40715..22cc36ab 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 731413e7..460cfcb2 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) """) |