[Python-checkins] r82130 - in python/trunk: Lib/distutils/msvc9compiler.py Misc/NEWS

benjamin.peterson python-checkins at python.org
Mon Jun 21 17:27:46 CEST 2010


Author: benjamin.peterson
Date: Mon Jun 21 17:27:46 2010
New Revision: 82130

Log:
fix finding visual studio 2008 on 64 bit #8854

Modified:
   python/trunk/Lib/distutils/msvc9compiler.py
   python/trunk/Misc/NEWS

Modified: python/trunk/Lib/distutils/msvc9compiler.py
==============================================================================
--- python/trunk/Lib/distutils/msvc9compiler.py	(original)
+++ python/trunk/Lib/distutils/msvc9compiler.py	Mon Jun 21 17:27:46 2010
@@ -37,10 +37,20 @@
          _winreg.HKEY_LOCAL_MACHINE,
          _winreg.HKEY_CLASSES_ROOT)
 
-VS_BASE = r"Software\Microsoft\VisualStudio\%0.1f"
-VSEXPRESS_BASE = r"Software\Microsoft\VCExpress\%0.1f"
-WINSDK_BASE = r"Software\Microsoft\Microsoft SDKs\Windows"
-NET_BASE = r"Software\Microsoft\.NETFramework"
+NATIVE_WIN64 = (sys.platform == 'win32' and sys.maxsize > 2**32)
+if NATIVE_WIN64:
+    # Visual C++ is a 32-bit application, so we need to look in
+    # the corresponding registry branch, if we're running a
+    # 64-bit Python on Win64
+    VS_BASE = r"Software\Wow6432Node\Microsoft\VisualStudio\%0.1f"
+    VSEXPRESS_BASE = r"Software\Wow6432Node\Microsoft\VCExpress\%0.1f"
+    WINSDK_BASE = r"Software\Wow6432Node\Microsoft\Microsoft SDKs\Windows"
+    NET_BASE = r"Software\Wow6432Node\Microsoft\.NETFramework"
+else:
+    VS_BASE = r"Software\Microsoft\VisualStudio\%0.1f"
+    VSEXPRESS_BASE = r"Software\Microsoft\VCExpress\%0.1f"
+    WINSDK_BASE = r"Software\Microsoft\Microsoft SDKs\Windows"
+    NET_BASE = r"Software\Microsoft\.NETFramework"
 
 # A map keyed by get_platform() return values to values accepted by
 # 'vcvarsall.bat'.  Note a cross-compile may combine these (eg, 'x86_amd64' is

Modified: python/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS	(original)
+++ python/trunk/Misc/NEWS	Mon Jun 21 17:27:46 2010
@@ -23,6 +23,11 @@
 - In the unicode/str.format(), raise a ValueError when indexes to arguments are
   too large.
 
+Build
+-----
+
+- Issue #8854: Fix finding Visual Studio 2008 on Windows x64.
+
 Library
 -------
 


More information about the Python-checkins mailing list