diff options
author | Craig Rodrigues <rodrigc@FreeBSD.org> | 2017-03-14 01:07:38 -0700 |
---|---|---|
committer | Craig Rodrigues <rodrigc@FreeBSD.org> | 2017-03-14 01:07:38 -0700 |
commit | e49851522a4791eef704a80be4710cb15843ad8e (patch) | |
tree | 1f85c7eca34123d8f61e91e9ad6d99a691efeac4 /test/Scanner | |
parent | 743f42a1559e5d1d73e1c8cca6fe82d72e336bc3 (diff) | |
download | scons-e49851522a4791eef704a80be4710cb15843ad8e.tar.gz |
Fix bytes issues to fix test on Python 3.
Diffstat (limited to 'test/Scanner')
-rw-r--r-- | test/Scanner/unicode.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/Scanner/unicode.py b/test/Scanner/unicode.py index 2737f7db..c6985322 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) |