a ˆåÏhMQ ã @ s d Z ddlZddlZddlZddlZddlZe e¡ ddl Z W d ƒ n1 sT0 Y ddl mZmZm Z mZmZ ddlmZmZ ddlmZ ddlmZ ddlmZ dd „ Zd d„ Zdd dddœZdd„ Zdd„ Zddd„ZdddddœZG dd„ deƒZ dS )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)ÚDistutilsExecErrorÚDistutilsPlatformErrorÚCompileErrorÚLibErrorÚ LinkError)Ú CCompilerÚgen_lib_options)Úlog)Úget_platform)Úcountc C s zt jt jdt jt jB d} W n ty< t d¡ Y dS 0 d}d }| ¬ tƒ D ]”}zt | |¡\}}}W n ty„ Y qèY n0 |rR|t j krRtj |¡rRztt|ƒƒ}W n ttfyÊ Y qRY n0 |dkrR||krR|| }}qRW d ƒ n1 sþ0 Y ||fS )Nz'Software\Microsoft\VisualStudio\SxS\VC7)ÚaccesszVisual C++ is not registered©NNr é )ÚwinregZ OpenKeyExÚHKEY_LOCAL_MACHINEZKEY_READZKEY_WOW64_32KEYÚOSErrorr Údebugr Z EnumValueZREG_SZÚosÚpathÚisdirÚintÚfloatÚ ValueErrorÚ TypeError)ÚkeyÚbest_versionÚbest_dirÚiÚvZvc_dirZvtÚversion© r úG/usr/lib/python3.9/site-packages/setuptools/_distutils/_msvccompiler.pyÚ_find_vc2015 s2 ý ,r" c C s t j d¡pt j d¡} | s dS z8tjt j | ddd¡ddd d ddd dg ddd ¡ }W n tjt t fyt Y dS 0 t j |ddd¡}t j |¡rœd|fS dS )aJ Returns "15, path" based on the result of invoking vswhere.exe If no install is found, returns "None, None" The version is returned to avoid unnecessarily changing the function result. It may be ignored when the path is not None. If vswhere.exe is not available, by definition, VS 2017 is not installed. zProgramFiles(x86)ZProgramFilesr zMicrosoft Visual StudioZ Installerzvswhere.exez-latestz-prereleasez -requiresz1Microsoft.VisualStudio.Component.VC.Tools.x86.x64z -propertyZinstallationPathz -productsÚ*ÚmbcsÚstrict)ÚencodingÚerrorsZVCZ AuxiliaryZBuildé )r ÚenvironÚgetÚ subprocessÚcheck_outputr ÚjoinÚstripÚCalledProcessErrorr ÚUnicodeDecodeErrorr )Úrootr r r r! Ú_find_vc2017<