Fix unicode encoder errors.
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Tue, 30 Aug 2005 02:28:48 +0000 (02:28 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Tue, 30 Aug 2005 02:28:48 +0000 (02:28 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@1343 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/engine/SCons/Tool/msvc.py

index 1077931e2c99ff8861306c32acb64059ff747265..d6ecbfafdcf8a6e5b592a0e8eff2285d308ad6d6 100644 (file)
@@ -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()