(exc, version, arch='')
Add details to the exception message to help guide the user
    as to what action will resolve it.
Add details to the exception message to help guide the user
    as to what action will resolve it.
Add details to the exception message to help guide the user as to what action will resolve it .
def _augment_exception(exc, version, arch=''):
    """
    Add details to the exception message to help guide the user
    as to what action will resolve it.
    """
    # Error if MSVC++ directory not found or environment not set
    message = exc.args[0]

    if "vcvarsall" in message.lower() or "visual c" in message.lower():
        # Special error message if MSVC++ not installed
        tmpl = 'Microsoft Visual C++ {version:0.1f} is required.'
        message = tmpl.format(**locals())
        msdownload = 'www.microsoft.com/download/details.aspx?id=%d'
        if version == 9.0:
            if arch.lower().find('ia64') > -1:
                # For VC++ 9.0, if IA64 support is needed, redirect user
                # to Windows SDK 7.0
                message += ' Get it with "Microsoft Windows SDK 7.0": '
                message += msdownload % 3138
            else:
                # For VC++ 9.0 redirect user to Vc++ for Python 2.7 :
                # This redirection link is maintained by Microsoft.
                # Contact vspython@microsoft.com if it needs updating.
                message += ' Get it from http://aka.ms/vcpython27'
        elif version == 10.0:
            # For VC++ 10.0 Redirect user to Windows SDK 7.1
            message += ' Get it with "Microsoft Windows SDK 7.1": '
            message += msdownload % 8279
        elif version >= 14.0:
            # For VC++ 14.0 Redirect user to Visual C++ Build Tools
            message += (' Get it with "Microsoft Visual C++ Build Tools": '
                        r'https://visualstudio.microsoft.com/downloads/')

    exc.args = (message, )
def _augment_exception ( exc , version , arch = '' ) : # Error if MSVC++ directory not found or environment not set message = exc . args [ 0 ] if "vcvarsall" in message . lower ( ) or "visual c" in message . lower ( ) : # Special error message if MSVC++ not installed tmpl = 'Microsoft Visual C++ {version:0.1f} is required.' message = tmpl . format ( * * locals ( ) ) msdownload = 'www.microsoft.com/download/details.aspx?id=%d' if version == 9.0 : if arch . lower ( ) . find ( 'ia64' ) > - 1 : # For VC++ 9.0, if IA64 support is needed, redirect user # to Windows SDK 7.0 message += ' Get it with "Microsoft Windows SDK 7.0": ' message += msdownload % 3138 else : # For VC++ 9.0 redirect user to Vc++ for Python 2.7 : # This redirection link is maintained by Microsoft. # Contact vspython@microsoft.com if it needs updating. message += ' Get it from http://aka.ms/vcpython27' elif version == 10.0 : # For VC++ 10.0 Redirect user to Windows SDK 7.1 message += ' Get it with "Microsoft Windows SDK 7.1": ' message += msdownload % 8279 elif version >= 14.0 : # For VC++ 14.0 Redirect user to Visual C++ Build Tools message += ( ' Get it with "Microsoft Visual C++ Build Tools": ' r'https://visualstudio.microsoft.com/downloads/' ) exc . args = ( message , )