]> granicus.if.org Git - python/commitdiff
Merged revisions 82130 via svnmerge from
authorBenjamin Peterson <benjamin@python.org>
Mon, 21 Jun 2010 15:37:16 +0000 (15:37 +0000)
committerBenjamin Peterson <benjamin@python.org>
Mon, 21 Jun 2010 15:37:16 +0000 (15:37 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r82130 | benjamin.peterson | 2010-06-21 10:27:46 -0500 (Mon, 21 Jun 2010) | 1 line

  fix finding visual studio 2008 on 64 bit #8854
........

Lib/distutils/msvc9compiler.py
Misc/NEWS

index 6455fffa1f635739df44a7f84359754dc619e415..15425d71942fa4bf824620f069c214317f9261f1 100644 (file)
@@ -37,9 +37,18 @@ HKEYS = (winreg.HKEY_USERS,
          winreg.HKEY_LOCAL_MACHINE,
          winreg.HKEY_CLASSES_ROOT)
 
-VS_BASE = r"Software\Microsoft\VisualStudio\%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"
+    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"
+    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
index 3d109f1569a005dd5b6c18f46c18f5e67be61113..550dda30a2c9622620756221fe07c8f5da3f2733 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -1441,6 +1441,8 @@ Extension Modules
 Build
 -----
 
+- Issue #8854: Fix finding Visual Studio 2008 on Windows x64.
+
 - Issue #1759169, #8864: Drop _XOPEN_SOURCE on Solaris, define it for
   multiprocessing only.