HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/lib/python3.9/site-packages/pip/_internal/utils/__pycache__/virtualenv.cpython-39.pyc
a

?�fz�@s�ddlmZddlZddlZddlZddlZddlZddlZddlm	Z	e	r\ddl
mZmZe�
e�Ze�d�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Zdd�ZdS)�)�absolute_importN)�MYPY_CHECK_RUNNING)�List�Optionalz8include-system-site-packages\s*=\s*(?P<value>true|false)cCstjttdtj�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_venvsrcCs
ttd�S)zmChecks if sys.real_prefix is set.

    This handles virtual environments created with pypa's virtualenv.
    Zreal_prefix)�hasattrrr
r
r
r�!_running_under_regular_virtualenvsrcCst�p
t�S)zGReturn True if we're running inside a virtualenv, False otherwise.
    )rrr
r
r
r�running_under_virtualenv(srcCsjtj�tjd�}z@tj|dd��}|����Wd�WS1sD0YWnt	ydYdS0dS)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�joinrr�io�open�read�
splitlines�IOError)Zpyvenv_cfg_file�fr
r
r�_get_pyvenv_cfg_lines/s0rcCsPt�}|durt�d�dS|D]*}t�|�}|dur |�d�dkr dSq dS)aZCheck `{sys.prefix}/pyvenv.cfg` for system site-packages inclusion

    PEP 405 specifies that when system site-packages are not supposed to be
    visible from a virtual environment, `pyvenv.cfg` must contain the following
    line:

        include-system-site-packages = false

    Additionally, log a warning if accessing the file fails.
    Nz�Could not access 'pyvenv.cfg' despite a virtual environment being active. Assuming global site-packages is not accessible in this environment.T�valueZfalseF)r�loggerZwarning�#_INCLUDE_SYSTEM_SITE_PACKAGES_REGEX�match�group)Z	cfg_lines�linerr
r
r�_no_global_under_venv?s�
r!cCs0tj�tj�tj��}tj�|d�}tj�|�S)z�Check if "no-global-site-packages.txt" exists beside site.py

    This mirrors logic in pypa/virtualenv for determining whether system
    site-packages are visible in the virtual environment.
    zno-global-site-packages.txt)rr�dirname�abspath�site�__file__r�exists)Zsite_mod_dirZno_global_site_packages_filer
r
r�#_no_global_under_regular_virtualenv]s
�r'cCst�rt�St�rt�SdS)zMReturns a boolean, whether running in venv with no system site-packages.
    F)rr!rr'r
r
r
r�virtualenv_no_globalks
r()Z
__future__rrZloggingr�rer$rZpip._internal.utils.typingr�typingrrZ	getLogger�__name__r�compilerrrrrr!r'r(r
r
r
r�<module>s(
�