summaryrefslogtreecommitdiff
path: root/QMTest
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2016-05-15 12:27:51 -0700
committerWilliam Deegan <bill@baddogconsulting.com>2016-05-15 12:27:51 -0700
commita87e77ce523efb2d90e996174fcd67bf75972236 (patch)
tree0533f345de9318cce1f4e73b6f0f0614f2959d03 /QMTest
parente35f2cc7dce4eb86eab5305d90773610eb6765f3 (diff)
downloadscons-a87e77ce523efb2d90e996174fcd67bf75972236.tar.gz
change to handle py3 changes to byte/string for open().write()
Diffstat (limited to 'QMTest')
-rw-r--r--QMTest/TestCmd.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/QMTest/TestCmd.py b/QMTest/TestCmd.py
index 198f586f..2fba0a08 100644
--- a/QMTest/TestCmd.py
+++ b/QMTest/TestCmd.py
@@ -1731,7 +1731,11 @@ class TestCmd(object):
file = self.canonicalize(file)
if mode[0] != 'w':
raise ValueError("mode must begin with 'w'")
- open(file, mode).write(content)
+ try:
+ open(file, mode).write(content)
+ except TypeError as e:
+ # python 3 default strings are not bytes, but unicode
+ open(file, mode).write(bytes(content,'utf-8'))
# Local Variables:
# tab-width:4