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

Function removeduppaths

Lib/site.py:136–152  ·  view source on GitHub ↗

Remove duplicate entries from sys.path along with making them absolute

()

Source from the content-addressed store, hash-verified

134
135
136def removeduppaths():
137 """ Remove duplicate entries from sys.path along with making them
138 absolute"""
139 # This ensures that the initial path provided by the interpreter contains
140 # only absolute pathnames, even if we're running from the build directory.
141 L = []
142 known_paths = set()
143 for dir in sys.path:
144 # Filter out duplicate paths (on case-insensitive file systems also
145 # if they only differ in case); turn relative paths into absolute
146 # paths.
147 dir, dircase = makepath(dir)
148 if dircase not in known_paths:
149 L.append(dir)
150 known_paths.add(dircase)
151 sys.path[:] = L
152 return known_paths
153
154
155def _init_pathinfo():

Callers 1

mainFunction · 0.85

Calls 4

setFunction · 0.85
makepathFunction · 0.85
appendMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected