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

Method splitroot

tools/python-3.11.9-amd64/Lib/pathlib.py:239–252  ·  view source on GitHub ↗
(self, part, sep=sep)

Source from the content-addressed store, hash-verified

237 is_supported = (os.name != 'nt')
238
239 def splitroot(self, part, sep=sep):
240 if part and part[0] == sep:
241 stripped_part = part.lstrip(sep)
242 # According to POSIX path resolution:
243 # http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap04.html#tag_04_11
244 # "A pathname that begins with two successive slashes may be
245 # interpreted in an implementation-defined manner, although more
246 # than two leading slashes shall be treated as a single slash".
247 if len(part) - len(stripped_part) == 2:
248 return '', sep * 2, stripped_part
249 else:
250 return '', sep, stripped_part
251 else:
252 return '', '', part
253
254 def casefold(self, s):
255 return s

Callers 1

parse_partsMethod · 0.45

Calls 1

lstripMethod · 0.80

Tested by

no test coverage detected