U ifRN @ s d Z ddlZddlZddlZddlZddlZddlmZmZm Z m Z mZ ddlm Z mZ ddlmZ ddlmZ ddlmZ dd Zd d Zdd dddZdd Zdd ZdddZdddddZG dd de ZdS )a distutils._msvccompiler Contains MSVCCompiler, an implementation of the abstract CCompiler class for Microsoft Visual Studio 2015. The module is compatible with VS 2015 and later. You can find legacy support for older versions in distutils.msvc9compiler and distutils.msvccompiler. N)DistutilsExecErrorDistutilsPlatformErrorCompileErrorLibError LinkError) CCompilergen_lib_options)log)get_platform)countc C s zt jt jdt jt jB d} W n tk r> td Y dS X d}d }| t D ]}zt | |\}}}W n tk r Y qY nX |rT|t j krTtj |rTztt|}W n ttfk r Y qTY nX |dkrT||krT|| }}qTW 5 Q R X ||fS )Nz'Software\Microsoft\VisualStudio\SxS\VC7)accesszVisual C++ is not registeredNNr )winregZ OpenKeyExHKEY_LOCAL_MACHINEZKEY_READZKEY_WOW64_32KEYOSErrorr debugr Z EnumValueZREG_SZospathisdirintfloat ValueError TypeError)keybest_versionbest_dirivZvc_dirZvtversion r