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

Function _adjust_cli_sys_path

Lib/pydoc.py:2790–2797  ·  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

2788
2789# Note: the tests only cover _get_revised_path, not _adjust_cli_path itself
2790def _adjust_cli_sys_path():
2791 """Ensures current directory is on sys.path, and __main__ directory is not.
2792
2793 Exception: __main__ dir is left alone if it's also pydoc's directory.
2794 """
2795 revised_path = _get_revised_path(sys.path, sys.argv[0])
2796 if revised_path is not None:
2797 sys.path[:] = revised_path
2798
2799
2800def cli():

Callers 1

cliFunction · 0.85

Calls 1

_get_revised_pathFunction · 0.85

Tested by

no test coverage detected