summaryrefslogtreecommitdiffstats
path: root/test/Scanner
diff options
context:
space:
mode:
authorCraig Rodrigues <rodrigc@FreeBSD.org>2017-03-14 08:07:38 (GMT)
committerCraig Rodrigues <rodrigc@FreeBSD.org>2017-03-14 08:07:38 (GMT)
commitbbcb88b0be70ae0bd3e578efa7a8558427b2f0ee (patch)
tree1f85c7eca34123d8f61e91e9ad6d99a691efeac4 /test/Scanner
parent948fe88f6115b50958f01dc5c065132bb27b5ed6 (diff)
downloadSCons-bbcb88b0be70ae0bd3e578efa7a8558427b2f0ee.zip
SCons-bbcb88b0be70ae0bd3e578efa7a8558427b2f0ee.tar.gz
SCons-bbcb88b0be70ae0bd3e578efa7a8558427b2f0ee.tar.bz2
Fix bytes issues to fix test on Python 3.
Diffstat (limited to 'test/Scanner')
-rw-r--r--test/Scanner/unicode.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/Scanner/unicode.py b/test/Scanner/unicode.py
index 2737f7d..c698532 100644
--- a/test/Scanner/unicode.py
+++ b/test/Scanner/unicode.py
@@ -56,6 +56,8 @@ def process(outfp, infile):
contents = contents[len(codecs.BOM_UTF16_LE):].decode('utf-16-le')
elif contents.startswith(codecs.BOM_UTF16_BE):
contents = contents[len(codecs.BOM_UTF16_BE):].decode('utf-16-be')
+ else:
+ contents = contents.decode('ascii')
for line in contents.split('\n')[:-1]:
if line[:8] == 'include ':
process(outfp, line[8:])
@@ -65,7 +67,7 @@ def process(outfp, infile):
else:
outfp.write(line + '\n')
-output = open(sys.argv[2], 'wb')
+output = open(sys.argv[2], 'w')
process(output, sys.argv[1])
sys.exit(0)