2bi
S SK r S SKrS SKrS SKrS SKrS SKJrJr \ R " \ 5 r
\R " S5 rS\
4S jrS\
4S jrS\
4S jrS\\\ 4S jrS\
4S jrS\
4S
jrS\
4S jrg) N)ListOptionalz8include-system-site-packages\s*=\s*(?Ptrue|false)returnc b [ R [ [ S[ R 5 :g $ )zfChecks if sys.base_prefix and sys.prefix match.
This handles PEP 405 compliant virtual environments.
base_prefix)sysprefixgetattr ڐ/builddir/build/BUILDROOT/alt-python313-pip-23.3.1-3.el8.x86_64/opt/alt/python313/lib/python3.13/site-packages/pip/_internal/utils/virtualenv.py_running_under_venvr s
::mSZZ@@@r c " [ [ S5 $ )zeChecks if sys.real_prefix is set.
This handles virtual environments created with pypa's virtualenv.
real_prefix)hasattrr r r r
_running_under_legacy_virtualenvr s 3
&&r c 8 [ 5 =( d
[ 5 $ )zDTrue if we're running inside a virtual environment, False otherwise.)r r r r r
running_under_virtualenvr s F$D$FFr c [ R R [ R S5 n [ U SS9 nUR
5 R 5 sSSS5 $ ! , ( d f g= f! [ a gf = f)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) ospathjoinr r openread
splitlinesOSError)pyvenv_cfg_filefs r
_get_pyvenv_cfg_linesr $ s^
ggll3::|