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.
()
| 592 | |
| 593 | |
| 594 | def 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. |
no test coverage detected