File: //usr/lib/python3/dist-packages/virtualenv/config/__pycache__/ini.cpython-310.pyc
o
$�"b � @ s| d dl mZmZ d dlZd dlZd dlmZ d dlmZ d dl m
Z
d dlmZ d dl
mZ dd lmZ G d
d� de�ZdS )� )�absolute_import�unicode_literalsN)�user_config_dir)�PY3)�ConfigParser)�Path)�
ensure_str� )�convertc @ sR e Zd Zed�Zdddd�ZdZddd �Zd
d� Zdd
� Z dd� Z
edd� �ZdS )� IniConfig�VIRTUALENV_CONFIG_FILEzfailed to parse�active�missing)NTF�
virtualenvNc
C s |d u rt jn|}|�| jd �}|d u| _|d urt|�n ttddd��d }|| _i | _d }d | _ z| j�
� | _ W n tyN } z|}W Y d }~n6d }~ww | j r�| j�� | _t
�
� | _z| �� | j�| j�| _W n ty } z|}W Y d }~nd }~ww |d ur�t�d||� d S d S )Nr �pypa)�appname� appauthorzvirtualenv.iniz(failed to read config file %s because %r)�os�environ�get�VIRTUALENV_CONFIG_FILE_ENV_VAR�
is_env_varr r �config_file�_cache�has_config_file�exists�OSError�resolver �
config_parser�_load�has_section�section�has_virtualenv_section� Exception�logging�error)�self�envr � exception�exc� r* �7/usr/lib/python3/dist-packages/virtualenv/config/ini.py�__init__ s<