관리-도구
편집 파일: py_spec.cpython-38.pyc
U *�eO � @ sb d Z ddlmZ ddlZddlZddlZddlmZ ddlm Z e� d�ZG dd� d�ZdgZ dS ) zOA Python specification is an abstract requirement definition of an interpreter.� )�annotationsN)�OrderedDict)�fs_is_case_sensitivez@^(?P<impl>[a-zA-Z]+)?(?P<version>[0-9.]+)?(?:-(?P<arch>32|64))?$c @ sT e Zd ZdZdd�dd�Zedd� �Zdd � Zed d� �Z dd � Z dd�dd�ZdS )� PythonSpecz2Contains specification about a Python Interpreter.�None)�returnc C s. || _ || _|| _|| _|| _|| _|| _d S �N)�str_spec�implementation�major�minor�micro�architecture�path)�selfr r r r r r r � r �J/opt/hc_python/lib/python3.8/site-packages/virtualenv/discovery/py_spec.py�__init__ s zPythonSpec.__init__c C sP d\}}}}}}t j�|�r$|}�nd}t�t|�} | �r2dd� } z�| �� }|d }|d k r�tdd� |�d�D ��} t | �d kr�t �t | �d kr�| \}}}nVt | �d kr�| \}}n@t | �dkr�| d }tt|�d �}|d kr�tt|�dd � �}d}W n t k �r Y n$X |d }|dk�r&d }| |d �}|�s<|}| |||||||�S )N)NNNNNNFc S s | d krd S t | �S r ��int)�valr r r �_int_or_none% s z1PythonSpec.from_string_spec.<locals>._int_or_none�versionc s s | ]}|rt |�V qd S r r ��.0�ir r r � <genexpr>, s z.PythonSpec.from_string_spec.<locals>.<genexpr>�.� � � r � T�impl> �py�python�arch) �osr �isabs�re�match�PATTERN� groupdict�tuple�split�len� ValueErrorr �str)�clsZstring_specr"