diff options
author | Benjamin Peterson <benjamin@python.org> | 2010-06-21 15:27:46 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2010-06-21 15:27:46 (GMT) |
commit | afa1b309690ef6ea93500660a4c6d85a515e07df (patch) | |
tree | a6850e48192a21ee2d6fcc5126fc434f867a8b07 /Lib | |
parent | a45e6d5791b6ba845beaa0dde2a297e810982741 (diff) | |
download | cpython-afa1b309690ef6ea93500660a4c6d85a515e07df.zip cpython-afa1b309690ef6ea93500660a4c6d85a515e07df.tar.gz cpython-afa1b309690ef6ea93500660a4c6d85a515e07df.tar.bz2 |
fix finding visual studio 2008 on 64 bit #8854
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/distutils/msvc9compiler.py | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/Lib/distutils/msvc9compiler.py b/Lib/distutils/msvc9compiler.py index 932b6ea..d5d7f66 100644 --- a/Lib/distutils/msvc9compiler.py +++ b/Lib/distutils/msvc9compiler.py @@ -37,10 +37,20 @@ HKEYS = (_winreg.HKEY_USERS, _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 |