MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / main

Function main

tools/python-3.11.9-amd64/Lib/site.py:594–621  ·  view source on GitHub ↗

Add standard site-specific directories to the module search path. This function is called automatically when this module is imported, unless the python interpreter was started with the -S flag.

()

Source from the content-addressed store, hash-verified

592
593
594def main():
595 """Add standard site-specific directories to the module search path.
596
597 This function is called automatically when this module is imported,
598 unless the python interpreter was started with the -S flag.
599 """
600 global ENABLE_USER_SITE
601
602 orig_path = sys.path[:]
603 known_paths = removeduppaths()
604 if orig_path != sys.path:
605 # removeduppaths() might make sys.path absolute.
606 # fix __file__ and __cached__ of already imported modules too.
607 abs_paths()
608
609 known_paths = venv(known_paths)
610 if ENABLE_USER_SITE is None:
611 ENABLE_USER_SITE = check_enableusersite()
612 known_paths = addusersitepackages(known_paths)
613 known_paths = addsitepackages(known_paths)
614 setquit()
615 setcopyright()
616 sethelper()
617 if not sys.flags.isolated:
618 enablerlcompleter()
619 execsitecustomize()
620 if ENABLE_USER_SITE:
621 execusercustomize()
622
623# Prevent extending of sys.path when python was started with -S and
624# site is imported later.

Callers 1

site.pyFile · 0.70

Calls 12

removeduppathsFunction · 0.85
abs_pathsFunction · 0.85
venvFunction · 0.85
check_enableusersiteFunction · 0.85
addusersitepackagesFunction · 0.85
addsitepackagesFunction · 0.85
setquitFunction · 0.85
setcopyrightFunction · 0.85
sethelperFunction · 0.85
enablerlcompleterFunction · 0.85
execsitecustomizeFunction · 0.85
execusercustomizeFunction · 0.85

Tested by

no test coverage detected