MCPcopy Index your code
hub / github.com/RustPython/RustPython / main

Function main

Lib/site.py:691–718  ·  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

689
690
691def main():
692 """Add standard site-specific directories to the module search path.
693
694 This function is called automatically when this module is imported,
695 unless the python interpreter was started with the -S flag.
696 """
697 global ENABLE_USER_SITE
698
699 orig_path = sys.path[:]
700 known_paths = removeduppaths()
701 if orig_path != sys.path:
702 # removeduppaths() might make sys.path absolute.
703 # fix __file__ and __cached__ of already imported modules too.
704 abs_paths()
705
706 known_paths = venv(known_paths)
707 if ENABLE_USER_SITE is None:
708 ENABLE_USER_SITE = check_enableusersite()
709 known_paths = addusersitepackages(known_paths)
710 known_paths = addsitepackages(known_paths)
711 setquit()
712 setcopyright()
713 sethelper()
714 if not sys.flags.isolated:
715 enablerlcompleter()
716 execsitecustomize()
717 if ENABLE_USER_SITE:
718 execusercustomize()
719
720# Prevent extending of sys.path when python was started with -S and
721# 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