MCPcopy Index your code
hub / github.com/python/cpython / _adjust_cli_sys_path

Function _adjust_cli_sys_path

Lib/pydoc.py:2742–2749  ·  view source on GitHub ↗

Ensures current directory is on sys.path, and __main__ directory is not. Exception: __main__ dir is left alone if it's also pydoc's directory.

()

Source from the content-addressed store, hash-verified

2740
2741# Note: the tests only cover _get_revised_path, not _adjust_cli_path itself
2742def _adjust_cli_sys_path():
2743 """Ensures current directory is on sys.path, and __main__ directory is not.
2744
2745 Exception: __main__ dir is left alone if it's also pydoc's directory.
2746 """
2747 revised_path = _get_revised_path(sys.path, sys.argv[0])
2748 if revised_path is not None:
2749 sys.path[:] = revised_path
2750
2751
2752def cli():

Callers 1

cliFunction · 0.85

Calls 1

_get_revised_pathFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…