File: //opt/saltstack/salt/lib/python3.10/distutils/__pycache__/_msvccompiler.cpython-310.pyc
o
�N�g'N � @ s� d Z ddlZddlZddlZddlmZmZmZmZm Z ddl
mZmZ ddl
mZ ddlmZ ddlmZ dd � Zd
d� Zdd
ddd�Zdd� Zdd� Zddd�Zddddd�ZG 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)�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 w d}d }| �_ t� D ]F}zt � | |�\}}}W n
ty@ Y n:w |ro|t j
krotj�
|�roztt|��}W n ttfya Y q)w |dkro||kro||}}q)W d � ||fS W d � ||fS 1 s�w Y ||fS )Nz'Software\Microsoft\VisualStudio\SxS\VC7)�accesszVisual C++ is not registered�NNr � )�winreg� 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! �=/opt/saltstack/salt/lib/python3.10/distutils/_msvccompiler.py�_find_vc2015 sH
�
�
��
��
�
�
�
�
r# c
C s� t j�d�pt j�d�} | sdS ztjt j�| ddd�ddd d
ddd
dg ddd��� }W n tjt t
fy: Y dS w t j�|ddd�}t j�|�rNd|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"