File: //lib/python3.9/site-packages/pip/_internal/utils/__pycache__/virtualenv.cpython-39.pyc
a
g��e�
� @ s� d dl Z d dlZd dlZd dlZd dlZd dlmZmZ e �e �Z
e�d�Zdd� Z
dd� Zdd � Zd
d� Zdd
� Zdd� Zdd� ZdS )� N)�List�Optionalz8include-system-site-packages\s*=\s*(?P<value>true|false)c C s t jtt dt j�kS )znChecks if sys.base_prefix and sys.prefix match.
This handles PEP 405 compliant virtual environments.
�base_prefix)�sys�prefix�getattr� r r �B/usr/lib/python3.9/site-packages/pip/_internal/utils/virtualenv.py�_running_under_venv s r
c C s
t td�S )zmChecks if sys.real_prefix is set.
This handles virtual environments created with pypa's virtualenv.
Zreal_prefix)�hasattrr r r r r �!_running_under_regular_virtualenv s r c C s t � p
t� S )zBReturn True if we're running inside a virtualenv, False otherwise.)r
r r r r r �running_under_virtualenv! s r
c C sh t j�tjd�} z>t| dd��}|�� �� W d � W S 1 sB0 Y W n tyb Y dS 0 dS )z�Reads {sys.prefix}/pyvenv.cfg and returns its contents as list of lines
Returns None, if it could not read/access the file.
z
pyvenv.cfgzutf-8)�encodingN) �os�path�joinr r �open�read�
splitlines�OSError)Zpyvenv_cfg_file�fr r r �_get_pyvenv_cfg_lines'