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.
()
| 689 | |
| 690 | |
| 691 | def 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. |
no test coverage detected