summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Script
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2017-04-10 18:40:50 (GMT)
committerWilliam Deegan <bill@baddogconsulting.com>2017-04-10 18:40:50 (GMT)
commit2c7b4f7cd5a2277208902c3b59c98b8530fd8698 (patch)
treed8d602570c20f015e68d572edd013fd5e33731ea /src/engine/SCons/Script
parenta66460a28e7672071cbb5c003332cfdc96669563 (diff)
downloadSCons-2c7b4f7cd5a2277208902c3b59c98b8530fd8698.zip
SCons-2c7b4f7cd5a2277208902c3b59c98b8530fd8698.tar.gz
SCons-2c7b4f7cd5a2277208902c3b59c98b8530fd8698.tar.bz2
py2/3 change to read sconscripts as binary file. at least test/packaging/rpm/internationalization.py was failing because an open in py3 without specified encoding with LANG=C was trying to decode the file as ascii and it contained unicode characters and was failing. So far I haven't found any tests failing from this change
Diffstat (limited to 'src/engine/SCons/Script')
-rw-r--r--src/engine/SCons/Script/SConscript.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/engine/SCons/Script/SConscript.py b/src/engine/SCons/Script/SConscript.py
index 8609892..558e28f 100644
--- a/src/engine/SCons/Script/SConscript.py
+++ b/src/engine/SCons/Script/SConscript.py
@@ -179,10 +179,10 @@ def _SConscript(fs, *files, **kw):
fs.chdir(top, change_os_dir=1)
if f.rexists():
actual = f.rfile()
- _file_ = open(actual.get_abspath(), "r")
+ _file_ = open(actual.get_abspath(), "rb")
elif f.srcnode().rexists():
actual = f.srcnode().rfile()
- _file_ = open(actual.get_abspath(), "r")
+ _file_ = open(actual.get_abspath(), "rb")
elif f.has_src_builder():
# The SConscript file apparently exists in a source
# code management system. Build it, but then clear
@@ -192,7 +192,7 @@ def _SConscript(fs, *files, **kw):
f.built()
f.builder_set(None)
if f.exists():
- _file_ = open(f.get_abspath(), "r")
+ _file_ = open(f.get_abspath(), "rb")
if _file_:
# Chdir to the SConscript directory. Use a path
# name relative to the SConstruct file so that if
@@ -248,6 +248,7 @@ def _SConscript(fs, *files, **kw):
pass
try:
try:
+# _file_ = SCons.Util.to_str(_file_)
exec(compile(_file_.read(), _file_.name, 'exec'),
call_stack[-1].globals)
except SConscriptReturn: