From: stevenknight Date: Tue, 30 Aug 2005 02:28:48 +0000 (+0000) Subject: Fix unicode encoder errors. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=eb31dcee76db123a2131884cc5c248919e502c11;p=scons.git Fix unicode encoder errors. git-svn-id: http://scons.tigris.org/svn/scons/trunk@1343 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- diff --git a/src/engine/SCons/Tool/msvc.py b/src/engine/SCons/Tool/msvc.py index 1077931e..d6ecbfaf 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()