diff options
author | William Deegan <bill@baddogconsulting.com> | 2017-04-16 18:21:23 (GMT) |
---|---|---|
committer | William Deegan <bill@baddogconsulting.com> | 2017-04-16 18:21:23 (GMT) |
commit | 3e6dce496daca4c98655b4544541828f36dce707 (patch) | |
tree | 32c12ecbadee7a92dff4c16e31731430e5ec5470 /src/engine/SCons/Tool | |
parent | e2644d7ee935b61f3307aafd376a9bca732f50bc (diff) | |
parent | 9ced8fe7b4e2f878df32ab3f606f851ac4cb6efc (diff) | |
download | SCons-3e6dce496daca4c98655b4544541828f36dce707.zip SCons-3e6dce496daca4c98655b4544541828f36dce707.tar.gz SCons-3e6dce496daca4c98655b4544541828f36dce707.tar.bz2 |
Merged in gauravjuvekar/scons (pull request #447)
Fix failing tests from merging #427
Diffstat (limited to 'src/engine/SCons/Tool')
-rw-r--r-- | src/engine/SCons/Tool/textfile.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/engine/SCons/Tool/textfile.py b/src/engine/SCons/Tool/textfile.py index 0e4d943..42a79cd 100644 --- a/src/engine/SCons/Tool/textfile.py +++ b/src/engine/SCons/Tool/textfile.py @@ -71,7 +71,11 @@ def _do_subst(node, subs): contents = re.sub(k, v, contents) if 'b' in TEXTFILE_FILE_WRITE_MODE: - contents = bytearray(contents, 'utf-8') + try: + contents = bytearray(contents, 'utf-8') + except UnicodeDecodeError: + # contents is already utf-8 encoded python 2 str i.e. a byte array + contents = bytearray(contents) return contents |