summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2005-08-30 02:28:48 (GMT)
committerSteven Knight <knight@baldmt.com>2005-08-30 02:28:48 (GMT)
commit573bedcc6ec6d1543b1f83a262a0e9407b13bda4 (patch)
tree51b56957d154d104b856352cd37100ccd264b509
parent2cc77f153d7518b23bc86666e4c7973bebc000d7 (diff)
downloadSCons-573bedcc6ec6d1543b1f83a262a0e9407b13bda4.zip
SCons-573bedcc6ec6d1543b1f83a262a0e9407b13bda4.tar.gz
SCons-573bedcc6ec6d1543b1f83a262a0e9407b13bda4.tar.bz2
Fix unicode encoder errors.
-rw-r--r--src/engine/SCons/Tool/msvc.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/engine/SCons/Tool/msvc.py b/src/engine/SCons/Tool/msvc.py
index 1077931..d6ecbfa 100644
--- a/src/engine/SCons/Tool/msvc.py
+++ b/src/engine/SCons/Tool/msvc.py
@@ -80,10 +80,9 @@ def _parse_msvc7_overrides(version):
try:
f = codecs.open(comps, 'r', 'utf16')
encoder = codecs.getencoder('ascii')
- except LookupError:
- lines = codecs.open(comps, 'r', 'utf8').readlines()
- else:
lines = map(lambda l, e=encoder: e(l)[0], f.readlines())
+ except (LookupError, UnicodeError):
+ lines = codecs.open(comps, 'r', 'utf8').readlines()
if lines is None:
lines = open(comps, 'r').readlines()