diff options
Diffstat (limited to 'BuildTools/SCons/Tools')
| -rw-r--r-- | BuildTools/SCons/Tools/textfile.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/BuildTools/SCons/Tools/textfile.py b/BuildTools/SCons/Tools/textfile.py index 89f8963..cc58666 100644 --- a/BuildTools/SCons/Tools/textfile.py +++ b/BuildTools/SCons/Tools/textfile.py @@ -57,19 +57,19 @@ from SCons.Util import is_String, is_Sequence, is_Dict def _do_subst(node, subs): """ Fetch the node contents and replace all instances of the keys with their values. For example, if subs is {'%VERSION%': '1.2345', '%BASE%': 'MyProg', '%prefix%': '/bin'}, then all instances of %VERSION% in the file will be replaced with 1.2345 and so forth. """ - contents = node.get_text_contents() + contents = node.get_contents().decode('utf-8') if not subs: return contents for (k,v) in subs: contents = re.sub(k, v, contents) return contents def _action(target, source, env): # prepare the line separator linesep = env['LINESEPARATOR'] if linesep is None: @@ -107,19 +107,19 @@ def _action(target, source, env): # write the file try: fd = open(target[0].get_path(), "wb") except (OSError,IOError), e: raise SCons.Errors.UserError("Can't write target file %s" % target[0]) # separate lines by 'linesep' only if linesep is not empty lsep = None for s in source: if lsep: fd.write(lsep) - fd.write(_do_subst(s, subs)) + fd.write(_do_subst(s, subs).encode("utf-8")) lsep = linesep fd.close() def _strfunc(target, source, env): return "Creating '%s'" % target[0] def _convert_list_R(newlist, sources): for elem in sources: if is_Sequence(elem): |
Swift