Commit 4d1852a9 authored by Steve Dower's avatar Steve Dower

Issue #25316: distutils raises OSError instead of DistutilsPlatformError when...

Issue #25316: distutils raises OSError instead of DistutilsPlatformError when MSVC is not installed.
parents a8ea322f f8a51950
...@@ -28,15 +28,17 @@ import winreg ...@@ -28,15 +28,17 @@ import winreg
from itertools import count from itertools import count
def _find_vcvarsall(plat_spec): def _find_vcvarsall(plat_spec):
with winreg.OpenKeyEx( try:
winreg.HKEY_LOCAL_MACHINE, key = winreg.OpenKeyEx(
r"Software\Microsoft\VisualStudio\SxS\VC7", winreg.HKEY_LOCAL_MACHINE,
access=winreg.KEY_READ | winreg.KEY_WOW64_32KEY r"Software\Microsoft\VisualStudio\SxS\VC7",
) as key: access=winreg.KEY_READ | winreg.KEY_WOW64_32KEY
if not key: )
log.debug("Visual C++ is not registered") except OSError:
return None, None log.debug("Visual C++ is not registered")
return None, None
with key:
best_version = 0 best_version = 0
best_dir = None best_dir = None
for i in count(): for i in count():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment