View file File name : pep425tags.cpython-36.opt-1.pyc Content :3 �Pf�* � @ s d Z ddlmZ ddlZddlZddlZddlZddlZyddlZW n e k rb ddl jZY nX ddlZddl mZ ddlZeje�Zejd�Zdd� Zdd � Zd d� Zdd � Zdd� Zd!dd�Zdd� Zdd� Zdd� Zdd� Zdd� Z d"dd�Z!e!� Z"e!dd �Z#e� Z$dS )#z2Generate and work with PEP 425 Compatibility Tags.� )�absolute_importN)�OrderedDictz(.+)_(\d+)_(\d+)_(.+)c C sB y t j| �S tk r< } ztjdj|�t� d S d }~X nX d S )Nz{0})� sysconfig�get_config_var�IOError�warnings�warn�format�RuntimeWarning)�var�e� r � /usr/lib/python3.6/pep425tags.pyr s r c C s: t td�rd} n&tjjd�r"d} ntjdkr2d} nd} | S )z'Return abbreviated implementation name.�pypy_version_info�pp�javaZjyZcliZip�cp)�hasattr�sys�platform� startswith)Zpyimplr r r � get_abbr_impl! s r c C s. t d�} | st� dkr*djttt� ��} | S )zReturn implementation version.�py_version_nodotr � )r r �join�map�str�get_impl_version_info)Zimpl_verr r r �get_impl_ver. s r c C s: t � dkr"tjd tjjtjjfS tjd tjd fS dS )zQReturn sys.version_info-like tuple for use in decrementing the minor version.r r � N)r r �version_infor �major�minorr r r r r 6 s r c C s dj t� t� �S )z; Returns the Tag for this specific implementation. z{0}{1})r r r r r r r �get_impl_tagA s r# Tc C s. t | �}|dkr&|r tjd| � |� S ||kS )zgUse a fallback method for determining SOABI flags if the needed config var is unset or unavailable.Nz>Config variable '%s' is unset, Python ABI tag may be incorrect)r �logger�debug)r Zfallback�expectedr �valr r r �get_flagH s r( c s� t d�} t� � | r�� dkr�ttd�r�d}d}d}tddd� � dkd �rLd }td� fdd�� dkd �rjd }tddd� d� dko�tjdk d�r�tjdk r�d}d� t� |||f }n@| r�| jd�r�d| jd�d }n| r�| j dd�j dd�}nd}|S )zXReturn the ABI tag based on SOABI (if available) or emulate SOABI (CPython 2, PyPy).�SOABIr r � maxunicoder �Py_DEBUGc S s t td�S )N�gettotalrefcount)r r r r r r �<lambda>^ s zget_abi_tag.<locals>.<lambda>)r �d� WITH_PYMALLOCc s � dkS )Nr r r )�implr r r- b s �mZPy_UNICODE_SIZEc S s t jdkS )Ni�� )r r* r r r r r- f s � � )r&