Prevent "Exp" in MSVC version name from causing problems.
authorgaryo <garyo@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Fri, 19 Mar 2010 17:35:08 +0000 (17:35 +0000)
committergaryo <garyo@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Fri, 19 Mar 2010 17:35:08 +0000 (17:35 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@4711 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/engine/SCons/Tool/MSCommon/vc.py

index 02f817c5bf79ad590570548d72a555adf29e4794..ae5415de1bcd613cd809bc19eae72503f0801bd9 100644 (file)
@@ -36,6 +36,7 @@ __doc__ = """Module for Visual C/C++ detection and configuration.
 """
 import SCons.compat
 
+import string
 import os
 import platform
 
@@ -216,7 +217,9 @@ def find_batch_file(env,msvc_version):
         
     debug('vc.py: find_batch_file() pdir:%s'%pdir)
 
-    vernum = float(msvc_version)
+    # filter out e.g. "Exp" from the version name
+    msvc_ver_numeric = string.join(filter(lambda x: x in string.digits + ".", msvc_version), '')
+    vernum = float(msvc_ver_numeric)
     if 7 <= vernum < 8:
         pdir = os.path.join(pdir, os.pardir, "Common7", "Tools")
         batfilename = os.path.join(pdir, "vsvars32.bat")