Hacked By AnonymousFox
B
YI~d�M � @ s� d dl Z d dlZd dlZd dlZd dlZd dlmZmZmZm Z m
Z
d dlmZm
Z
d dlmZ d dlmZ d dlmZ dd� Zd d
� Zdd� Zd
d� Zddd�Zddd�ZG dd� de�ZdS )� N)�DistutilsExecError�DistutilsPlatformError�CompileError�LibError� LinkError)� CCompiler�gen_lib_options)�log)�get_platform)�countc C s� yt jt jdt jt jB d�} W n tk
r< t�d� dS X d}d }| �� x�t� D ]�}yt � | |�\}}}W n tk
r� P Y nX |rT|t j
krTtj�
|�rTytt|��}W n ttfk
r� wTY nX |dkrT||krT|| }}qTW W d Q R X ||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 �</opt/alt/python37/lib64/python3.7/distutils/_msvccompiler.py�_find_vc2015 s0
r! c
C s� dd l } tj�d�ptj�d�}|s(dS y8tjtj�|ddd�dd d
ddd
ddg ddd��� }W n tj t
tfk
r| dS X tj�|ddd�}tj�|�r�d|fS dS )Nr zProgramFiles(x86)ZProgramFiles)NNzMicrosoft Visual StudioZ Installerzvswhere.exez-latestz-prereleasez -requiresz1Microsoft.VisualStudio.Component.VC.Tools.x86.x64z -propertyZinstallationPathz -products�*�mbcs�strict)�encoding�errorsZVCZ AuxiliaryZBuild� )
�jsonr �environ�get�
subprocess�check_outputr �join�strip�CalledProcessErrorr �UnicodeDecodeErrorr )r( �rootr r r r �_find_vc2017: s&