MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / removeduppaths

Function removeduppaths

tools/python-3.11.9-amd64/Lib/site.py:129–145  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

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

Callers 1

mainFunction · 0.85

Calls 4

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

Tested by

no test coverage detected