From c7b7e8df063211388131b0a1f5bc9274525c106c Mon Sep 17 00:00:00 2001 From: stevenknight Date: Sat, 20 Dec 2008 14:01:33 +0000 Subject: [PATCH] Issue 2276: Fix use of codecs module in pre-2.3 Python versions. git-svn-id: http://scons.tigris.org/svn/scons/trunk@3836 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- src/engine/SCons/Node/FS.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py index bdc1bfd2..4e89e8d4 100644 --- a/src/engine/SCons/Node/FS.py +++ b/src/engine/SCons/Node/FS.py @@ -51,6 +51,19 @@ try: import codecs except ImportError: pass +else: + # TODO(2.2): Remove when 2.3 becomes the minimal supported version. + try: + codecs.BOM_UTF8 + except AttributeError: + codecs.BOM_UTF8 = '\xef\xbb\xbf' + try: + codecs.BOM_UTF16 + except AttributeError: + if sys.byteorder == 'little': + codecs.BOM_UTF16 = '\xff\xfe' + else: + codecs.BOM_UTF16 = '\xfe\xff' import SCons.Action from SCons.Debug import logInstanceCreation -- 2.26.2