diff options
-rw-r--r-- | src/engine/SCons/Node/FS.py | 8 | ||||
-rw-r--r-- | src/engine/SCons/Tool/FortranCommon.py | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py index 9b7e105..0de3989 100644 --- a/src/engine/SCons/Node/FS.py +++ b/src/engine/SCons/Node/FS.py @@ -696,7 +696,7 @@ class Base(SCons.Node.Node): return self._memo['_save_str'] except KeyError: pass - result = sys.intern(self._get_str()) + result = SCons.Util.silent_intern(self._get_str()) self._memo['_save_str'] = result return result @@ -2670,7 +2670,11 @@ class File(Base): return contents[len(codecs.BOM_UTF16_LE):].decode('utf-16-le') if contents.startswith(codecs.BOM_UTF16_BE): return contents[len(codecs.BOM_UTF16_BE):].decode('utf-16-be') - return contents + try: + return contents.decode() + except UnicodeDecodeError: + return contents + def get_content_hash(self): """ diff --git a/src/engine/SCons/Tool/FortranCommon.py b/src/engine/SCons/Tool/FortranCommon.py index 1503639..e450730 100644 --- a/src/engine/SCons/Tool/FortranCommon.py +++ b/src/engine/SCons/Tool/FortranCommon.py @@ -64,7 +64,7 @@ def _fortranEmitter(target, source, env): if not node.exists() and not node.is_derived(): print("Could not locate " + str(node.name)) return ([], []) - mod_regex = b"(?i)^\s*MODULE\s+(?!PROCEDURE)(\w+)" + mod_regex = """(?i)^\s*MODULE\s+(?!PROCEDURE)(\w+)""" cre = re.compile(mod_regex,re.M) # Retrieve all USE'd module names modules = cre.findall(node.get_text_contents()) |