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

Function pathdirs

Lib/pydoc.py:99–109  ·  view source on GitHub ↗

Convert sys.path into a list of absolute, existing, unique paths.

()

Source from the content-addressed store, hash-verified

97# --------------------------------------------------------- common routines
98
99def pathdirs():
100 """Convert sys.path into a list of absolute, existing, unique paths."""
101 dirs = []
102 normdirs = []
103 for dir in sys.path:
104 dir = os.path.abspath(dir or '.')
105 normdir = os.path.normcase(dir)
106 if normdir not in normdirs and os.path.isdir(dir):
107 dirs.append(dir)
108 normdirs.append(normdir)
109 return dirs
110
111def _findclass(func):
112 cls = sys.modules.get(func.__module__)

Callers

nothing calls this directly

Calls 3

normcaseMethod · 0.80
isdirMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected