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

Function removeduppaths

Lib/site.py:134–150  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

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

Used in the wild real call sites across dependent graphs

searching dependent graphs…