summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2008-12-20 14:01:33 (GMT)
committerSteven Knight <knight@baldmt.com>2008-12-20 14:01:33 (GMT)
commit77ba6ff83fa8a55e6de1802322a127c92165351c (patch)
tree48dad1e2233900e368df42030ce96593c1855648
parent8fac1445b77f132510d132f5d0f24c6295c98b33 (diff)
downloadSCons-77ba6ff83fa8a55e6de1802322a127c92165351c.zip
SCons-77ba6ff83fa8a55e6de1802322a127c92165351c.tar.gz
SCons-77ba6ff83fa8a55e6de1802322a127c92165351c.tar.bz2
Issue 2276: Fix use of codecs module in pre-2.3 Python versions.
-rw-r--r--src/engine/SCons/Node/FS.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py
index bdc1bfd..4e89e8d 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