Commit 4751aeef authored by J. Goutin's avatar J. Goutin Committed by GitHub

Update msvc.py

parent b90df6dd
...@@ -3,7 +3,6 @@ This module adds improved support for Microsoft Visual C++ compilers. ...@@ -3,7 +3,6 @@ This module adds improved support for Microsoft Visual C++ compilers.
""" """
import os import os
import collections
import itertools import itertools
import distutils.errors import distutils.errors
from setuptools.extern.six.moves import filterfalse from setuptools.extern.six.moves import filterfalse
...@@ -21,7 +20,7 @@ except ImportError: ...@@ -21,7 +20,7 @@ except ImportError:
HKEY_CURRENT_USER = None HKEY_CURRENT_USER = None
HKEY_LOCAL_MACHINE = None HKEY_LOCAL_MACHINE = None
HKEY_CLASSES_ROOT = None HKEY_CLASSES_ROOT = None
safe_env = collections.defaultdict(lambda: '') safe_env = dict()
try: try:
...@@ -237,10 +236,6 @@ def _augment_exception(exc, version, arch=''): ...@@ -237,10 +236,6 @@ def _augment_exception(exc, version, arch=''):
# For VC++ 10.0 Redirect user to Windows SDK 7.1 # For VC++ 10.0 Redirect user to Windows SDK 7.1
message += ' Get it with "Microsoft Windows SDK 7.1": ' message += ' Get it with "Microsoft Windows SDK 7.1": '
message += msdownload % 8279 message += msdownload % 8279
elif version >= 14.0:
# For VC++ 14.0 Redirect user to Visual C++ Build Tools
message += ' Get it with "Visual C++ Build Tools": '
r'http://landinghub.visualstudio.com/visual-cpp-build-tools'
exc.args = (message, ) exc.args = (message, )
...@@ -254,7 +249,7 @@ class PlatformInfo: ...@@ -254,7 +249,7 @@ class PlatformInfo:
arch: str arch: str
Target architecture. Target architecture.
""" """
current_cpu = safe_env['processor_architecture'].lower() current_cpu = safe_env.get('processor_architecture', '').lower()
def __init__(self, arch): def __init__(self, arch):
self.arch = arch.lower().replace('x64', 'amd64') self.arch = arch.lower().replace('x64', 'amd64')
...@@ -467,9 +462,9 @@ class SystemInfo: ...@@ -467,9 +462,9 @@ class SystemInfo:
""" """
# Variables and properties in this class use originals CamelCase variables # Variables and properties in this class use originals CamelCase variables
# names from Microsoft source files for more easy comparaison. # names from Microsoft source files for more easy comparaison.
WinDir = safe_env['WinDir'] WinDir = safe_env.get('WinDir', '')
ProgramFiles = safe_env['ProgramFiles'] ProgramFiles = safe_env.get('ProgramFiles', '')
ProgramFilesx86 = os.environ.get('ProgramFiles(x86)', ProgramFiles) ProgramFilesx86 = safe_env.get('ProgramFiles(x86)', ProgramFiles)
def __init__(self, registry_info, vc_ver=None): def __init__(self, registry_info, vc_ver=None):
self.ri = registry_info self.ri = registry_info
......
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