summaryrefslogtreecommitdiffstats
path: root/src/engine
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2017-11-14 20:28:34 (GMT)
committerWilliam Deegan <bill@baddogconsulting.com>2017-11-14 20:28:34 (GMT)
commit7c74ee56fc5b9006d16148f5cc6ee3758507a38b (patch)
tree56f8da4d2ef2112978c4172c5bbe0f31a5e010f6 /src/engine
parent42b4f70c47b964d4c611247f4b9c24946aa2bbda (diff)
downloadSCons-7c74ee56fc5b9006d16148f5cc6ee3758507a38b.zip
SCons-7c74ee56fc5b9006d16148f5cc6ee3758507a38b.tar.gz
SCons-7c74ee56fc5b9006d16148f5cc6ee3758507a38b.tar.bz2
Fix messaging when two environments are specified for same target to handle when the action cannot be decoded as UTF-8. This most likely only happens when the action is a python function. It was breaking (at least) some example output generated for documentation
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/SCons/Builder.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/engine/SCons/Builder.py b/src/engine/SCons/Builder.py
index b5f1a92..010d5ff 100644
--- a/src/engine/SCons/Builder.py
+++ b/src/engine/SCons/Builder.py
@@ -307,7 +307,10 @@ def _node_errors(builder, env, tlist, slist):
msg = "Two different environments were specified for target %s,\n\tbut they appear to have the same action: %s" % (t, action.genstring(tlist, slist, t.env))
SCons.Warnings.warn(SCons.Warnings.DuplicateEnvironmentWarning, msg)
else:
- msg = "Two environments with different actions were specified for the same target: %s\n(action 1: %s)\n(action 2: %s)" % (t,t_contents.decode('utf-8'),contents.decode('utf-8'))
+ try:
+ msg = "Two environments with different actions were specified for the same target: %s\n(action 1: %s)\n(action 2: %s)" % (t,t_contents.decode('utf-8'),contents.decode('utf-8'))
+ except UnicodeDecodeError as e:
+ msg = "Two environments with different actions were specified for the same target: %s"%t
raise UserError(msg)
if builder.multi:
if t.builder != builder: