summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2016-05-19 09:03:06 -0700
committerWilliam Deegan <bill@baddogconsulting.com>2016-05-19 09:03:06 -0700
commit01ab580ffdd90459f729d44efa6a3f0cc733fbf5 (patch)
tree2b58b0f511f4f9aa2059ae2ec11695d3889c4b38
parent7d7012b21a1434ab03cead57e4b8926c8b5ef153 (diff)
downloadscons-git-01ab580ffdd90459f729d44efa6a3f0cc733fbf5.tar.gz
Fix unicode type code to handle py2/3
-rw-r--r--src/engine/SCons/Util.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/engine/SCons/Util.py b/src/engine/SCons/Util.py
index a5a92faef..0be6196ae 100644
--- a/src/engine/SCons/Util.py
+++ b/src/engine/SCons/Util.py
@@ -55,9 +55,13 @@ except ImportError as e:
MethodType = types.MethodType
FunctionType = types.FunctionType
-try: unicode
-except NameError: UnicodeType = None
-else: UnicodeType = unicode
+
+try:
+ unicode
+except NameError:
+ UnicodeType = str
+else:
+ UnicodeType = unicode
def dictify(keys, values, result={}):
for k, v in zip(keys, values):
@@ -172,7 +176,7 @@ class DisplayEngine(object):
return
if append_newline: text = text + '\n'
try:
- sys.stdout.write(unicode(text))
+ sys.stdout.write(UnicodeType(text))
except IOError:
# Stdout might be connected to a pipe that has been closed
# by now. The most likely reason for the pipe being closed