diff options
author | Gaurav Juvekar <gauravjuvekar@gmail.com> | 2017-03-27 07:02:29 (GMT) |
---|---|---|
committer | Gaurav Juvekar <gauravjuvekar@gmail.com> | 2017-03-27 07:02:29 (GMT) |
commit | 52f4d73e7b8577660ccf9d8c0a9f6fb5837c2e28 (patch) | |
tree | 2bb003e6b01f19574d54be840f180a3333123a90 /test | |
parent | b34164950ee97eb57f28ed665137e95de70effb9 (diff) | |
download | SCons-52f4d73e7b8577660ccf9d8c0a9f6fb5837c2e28.zip SCons-52f4d73e7b8577660ccf9d8c0a9f6fb5837c2e28.tar.gz SCons-52f4d73e7b8577660ccf9d8c0a9f6fb5837c2e28.tar.bz2 |
Make --tree=all work with Python 3
The codecs module is used which is distributed in the python standard library.
Diffstat (limited to 'test')
-rw-r--r-- | test/option--tree.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/option--tree.py b/test/option--tree.py index 1c1832b..a9618d8 100644 --- a/test/option--tree.py +++ b/test/option--tree.py @@ -57,7 +57,14 @@ test.write('SConstruct', """ env = Environment() env.Tool("textfile") -env.Textfile("Foo", unichr(0xe7).encode('utf-8')) +try: + # Python 2 + write = unichr(0xe7).encode('utf-8') +except NameError: + # Python 3 + # str is utf-8 by default + write = chr(0xe7) +env.Textfile("Foo", write) """) test.run(arguments = '-Q --tree=all', |