a �DOg��� @s�dZdZddlZddlZddlZddlZddlZddlZddlZddddddddd d d � Z e� d �Z d d �Z e� dej �Zd|dd�Zd}dd�Ze� d�Zd~dd�Zdddddddd d!d"d#d$� Zdd%d&d'd(d)d*�Zd+d,�Zd-d.�Zdd/d0�Zd1d2�Zd�d4d5�Zd6d7�Zd�d8d9�Zd:d;�Zdd?�Zd@dA�Zd�dBdC�Z dDdEdFd�Z!ej"ddfdGdH�Z#dIdJ�Z$GdKdL�dL�Z%dMdN�Z&GdOdP�dPe�'dQdR��Z(da)dSdT�Z*dUdV�Z+dWdX�Z,dYdZ�Z-d[d\�Z.d]d^�Z/d_d`�Z0e� daej �Z1e� dbej �Z2e� dc�Z3e� dd�Z4iZ5d�dedf�Z6dgdh�Z7didj�Z8dkdl�Z9dmdn�Z:dodp�Z;dqdr�Zd�dudv�Z?e@dwk�r�dxejAv�pldyejAvZBdzejAv�o�d{ejAvZCeDe?eCeB��e�Ed�dS)�a Copyright (c) 1999-2000, Marc-Andre Lemburg; mailto:mal@lemburg.com Copyright (c) 2000-2010, eGenix.com Software GmbH; mailto:info@egenix.com Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee or royalty is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation or portions thereof, including modifications, that you make. EGENIX.COM SOFTWARE GMBH DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE ! z1.0.8�N� ���(�2��) �dev�alpha�a�beta�b�cZRC�rc�pl�pz([0-9]+|[._+-])c Cs`g}t�|�D]L}|dvrzt|d�}d}WntyJt�|d�}Yn0|�||f�q|S)Nz._+-r�dr)� _component_re�split�int� ValueError� _ver_stages�get�extend)�version�result�v�t�r� /usr/lib64/python3.9/platform.py�_comparable_version�s  rsC(__libc_init)|(GLIBC_([0-9.]+))|(libc(_\w+)?\.so(?:\.(\d[0-9.]*))?)��@c Cs|durXz0t�d�}|jdd�}t|�dkr6t|�WSWntttfyPYn0tj }t }t tj d�rttj � |�}t|d���j}|�|�}d} | t|�k�r�d|vs�d |vr�t�|| �} nd} | r�| ��t|�k�r|�|�} | �r |t| t|�d �d�| }d} q�| �s�q�d d �| ��D�\} } }}}}| �rD|�sDd }n�| �rv|dk�r^d}|}n||�||�k�r�|}n\|�r�|dk�r�d }|�r�|�r�||�||�k�r�|}|�r�|t|� d�|k�r�||}| ��} q�Wd�n1�s�0Y||fS)N�CS_GNU_LIBC_VERSION�)�maxsplit��realpath�rbrslibcsGLIBCi�cSs"g|]}|dur|�d�n|�qS)N�latin1)�decode)�.0�srrr� �s�zlibc_ver..�libc�glibc)�os�confstrr�len�tuple�AttributeErrorr�OSError�sys� executabler�hasattr�pathr&�open�read� _libc_search�search�end�max�groups)r6�libr� chunksize�ver�parts�V�f�binary�pos�m�chunkZlibcinitr.Z glibcversionZso�threadsZ soversionrrr�libc_ver�s^       �   *rKcCs^|�d�}|r|�|�zttttt|���}WntyF|}Yn0d�|dd��}|S)N�.�)r�append�list�map�strrr�join)r�build�l�stringsrrr� _norm_version�s    rVz'(?:([\w ]+) ([\w.]+) .*\[.* ([\d.]+)\])��win32�win16�dosc Cs�tj|vr|||fSddl}dD]\}z|j||j|jddd�}Wn6t|jfyv}zWYd}~q WYd}~q d}~00q�q |||fS|��}t� |�}|dur�|� �\}}}|ddkr�|dd�}|ddkr�|dd�}t |�}|||fS)Nr)rBzcommand /c verz cmd /c verT)�stdin�stderr�text�shell�����rL) r5�platform� subprocess� check_output�DEVNULLr4�CalledProcessError�strip� _ver_output�matchr?rV) �system�releaserZsupported_platformsra�cmd�info�whyrHrrr� _syscmd_vers2  � "      rmZ2000ZXPZ 2003ServerZpost2003�Vista�7�8z8.1zpost8.1Z10Zpost10) )�r)rqr#�rqr%)rqN��r�rtr#�rtr%�rtrM�rtN)rr)rNZ 2008ServerZ 2008ServerR2Z 2012ServerZ 2012ServerR2Zpost2012ServerR2)rrrsrurvrwrxcCs t�dvS)N)ZIoTUAPZ NanoServerZWindowsCoreHeadlessZ IoTEdgeOS)� win32_editionrrrr� win32_is_iotSsrzcCs�z,z ddl}Wnty(ddl}Yn0Wnty>Yn^0zHd}|�|j|��"}|�|d�dWd�WS1s|0YWnty�Yn0dS)Nr�,SOFTWARE\Microsoft\Windows NT\CurrentVersionZ EditionId)�winreg� ImportError�_winreg� OpenKeyEx�HKEY_LOCAL_MACHINE� QueryValueExr4)r|�cvkey�keyrrrryVs   4 ryc Cs�zddlm}Wnty.||||fYS0|�}z ttt�d�d��\}}}Wn*ty�|jpt|dd�\}}}Yn0d� |||�}t � ||f�p�t � |df�p�|}|dd�||fk�rzd� |j �}Wn6t �y |dd�d k�rd |dd�}Yn0t|d d�dk�rDt� ||f��pBt� |df��pB|}z.z ddl} Wnt�ynddl} Yn0Wnt�y�Yn`0zHd } | �| j| �� } | �| d �d}Wd�n1�s�0YWnt�y�Yn0||||fS)Nr)�getwindowsversionr%rLrMz {0}.{1}.{2}zSP{}� z Service Pack ZSPZ product_typer{Z CurrentType)r5r�r}rPrrmrrZplatform_version�format�_WIN32_CLIENT_RELEASESrZservice_pack_majorr3�getattr�_WIN32_SERVER_RELEASESr|r~rr�r�r4) rir�csd�ptyper�Zwinver�major�minorrSr|r�r�rrr� win32_verhsR    �� �� 4r�cCs�d}tj�|�sdSz ddl}Wnty4YdS0t|d��}|�|�}Wd�n1s`0Y|d}d}t��j}|dvr�d}|||fS)Nz0/System/Library/CoreServices/SystemVersion.plistrr'ZProductVersion�r r r )ZppczPower MacintoshZPowerPC) r/r8�exists�plistlibr}r9�load�uname�machine)�fnr�rErri� versioninfor�rrr� _mac_ver_xml�s    ( r�r�cCst�}|dur|S|||fS�N)r�)rir�r�rkrrr�mac_ver�s r�cCsFddlm}z|�|�}|dur&|WS|WSty@|YS0dS)Nr)�System)� java.langr�Z getPropertyr3)�name�defaultr��valuerrr� _java_getprop�s   r�c Cs�z ddl}Wnty*||||fYS0td|�}td|�}|\}}}td|�}td|�}td|�}|||f}|\}} } td| �} td|�}td | �} || | f}||||fS) Nrz java.vendorz java.versionz java.vm.namezjava.vm.vendorzjava.vm.versionz java.os.archz java.os.namezjava.os.version)r�r}r�) ri�vendor�vminfo�osinfo�javaZvm_nameZ vm_releaseZ vm_vendor�os_name� os_version�os_archrrr�java_ver�s"               r�cCs�|dkr~|dkr|||fS|�d�}|rjzt|d�}WntyJYn 0|d}t|�|d<d�|�}|dkrxd}q�d}n,|dkr�d }|r�|d }q�d }n |d vr�d }|||fS)NZSunOS�5rLrrM�6ZSolarisZIRIX64ZIRIXz (64bit)�64bit�rXrY�Windows)rrrrQrR)rhrirrTr�rrr� system_alias�s.       r�cGs�d�dd�tt|�D��}|�dd�}|�dd�}|�dd�}|�dd�}|�d d�}|�d d�}|�d d�}|�d d�}|�d d�}|�dd�}||kr�q�|}q�|ddkr�|dd�}q�|S)N�-css|]}|��VqdSr�)re)r*�xrrr� ,�z_platform..� �_�/�\�:�;�"�(�)�unknownr z--r_)rR�filterr1�replace)�argsr`Zcleanedrrr� _platform&s"           r�cCsJz ddl}Wnty"|YS0z |��WStyD|YS0dS�Nr)�socketr}� gethostnamer4)r�r�rrr�_nodeFs     r�cCsBtj�|�}tj�|�r>tj�tj�tj�|�t�|���}q |Sr�)r/r8�abspath�islink�normpathrR�dirname�readlink)�filepathrrr�_follow_symlinksUs   �r�c Csxtjdvr|Sddl}t|�}ttjdd�}z|jdd|g|j|d�}Wnt |j fyd|YS0|sn|S|� d�S) N)rZrXrYr�C)�LC_ALL�filez-b)r\�envzlatin-1) r5r`rar��dictr/�environrbrcr4rdr))�targetr�rar��outputrrr� _syscmd_fileas  �  r�)r � WindowsPE)r r�)r �MSDOScCs|s&ddl}|�d�}t|d�d}|r6t|d�}nd}|sx|tjkrxtjtvrpttj\}}|rh|}|rp|}||fSd|vr�d|vr�||fSd|vr�d }nd |vr�d }n d |vr�d }d|vr�d}n8d|vr�d|vr�d}q�d}nd|vr�d}nd|vr�d}n||fS)Nr�P��bitr r6z shared objectz32-bit�32bitZN32Zn32bitz64-bitr�ZELFZPEr�r�ZCOFFzMS-DOSr�)�struct�calcsizerQr�r5r6r`�_default_architecture)r6�bits�linkager��sizeZfileoutr rTrrr� architecture�sH  � r�cCstj�dd�ptj�dd�S)NZPROCESSOR_ARCHITEW6432r ZPROCESSOR_ARCHITECTURE)r/r�rrrrr�_get_machine_win32�s �r�c@s0eZdZedd��Zdd�Zdd�Zdd�Zd S) � _ProcessorcCs t|dtj��|j�}|�pdS)NZget_r )r�r5r`�from_subprocess)�cls�funcrrrr�sz_Processor.getcCstj�dt��S)NZPROCESSOR_IDENTIFIER)r/r�rr�rrrr� get_win32�sz_Processor.get_win32cCsDz ddl}WntyYn"0|�dd�\}}|dkr\s� � � G  � 2��  3  #4  $�O   ��*Y     ���� h      L