diff options
author | William Deegan <bill@baddogconsulting.com> | 2016-05-15 19:27:51 (GMT) |
---|---|---|
committer | William Deegan <bill@baddogconsulting.com> | 2016-05-15 19:27:51 (GMT) |
commit | c5e30d23ebc878acb8e16e025b6f55aaab43f3a5 (patch) | |
tree | 0533f345de9318cce1f4e73b6f0f0614f2959d03 | |
parent | 6d8e680806a555ce1a72f76dc2ed9dad9bbb9bf7 (diff) | |
download | SCons-c5e30d23ebc878acb8e16e025b6f55aaab43f3a5.zip SCons-c5e30d23ebc878acb8e16e025b6f55aaab43f3a5.tar.gz SCons-c5e30d23ebc878acb8e16e025b6f55aaab43f3a5.tar.bz2 |
change to handle py3 changes to byte/string for open().write()
-rw-r--r-- | QMTest/TestCmd.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/QMTest/TestCmd.py b/QMTest/TestCmd.py index 198f586..2fba0a0 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 |