summaryrefslogtreecommitdiff
path: root/test/option--tree.py
diff options
context:
space:
mode:
authorGaurav Juvekar <gauravjuvekar@gmail.com>2017-03-27 12:32:29 +0530
committerGaurav Juvekar <gauravjuvekar@gmail.com>2017-03-27 12:32:29 +0530
commit15ab87034c1bba7fc8db9108136daa5f0ccba215 (patch)
tree2bb003e6b01f19574d54be840f180a3333123a90 /test/option--tree.py
parent41322bd7b5c6383af672ba6f78a8ce204ec588f4 (diff)
downloadscons-15ab87034c1bba7fc8db9108136daa5f0ccba215.tar.gz
Make --tree=all work with Python 3
The codecs module is used which is distributed in the python standard library.
Diffstat (limited to 'test/option--tree.py')
-rw-r--r--test/option--tree.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/option--tree.py b/test/option--tree.py
index 1c1832be..a9618d87 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',