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

Function ismount

Lib/ntpath.py:280–297  ·  view source on GitHub ↗

Test whether a path is a mount point (a drive root, the root of a share, or a mounted volume)

(path)

Source from the content-addressed store, hash-verified

278except ImportError:
279 _getvolumepathname = None
280def ismount(path):
281 """Test whether a path is a mount point (a drive root, the root of a
282 share, or a mounted volume)"""
283 path = os.fspath(path)
284 seps = _get_bothseps(path)
285 path = abspath(path)
286 drive, root, rest = splitroot(path)
287 if drive and drive[0] in seps:
288 return not rest
289 if root and not rest:
290 return True
291
292 if _getvolumepathname:
293 x = path.rstrip(seps)
294 y =_getvolumepathname(path).rstrip(seps)
295 return x.casefold() == y.casefold()
296 else:
297 return False
298
299
300_reserved_chars = frozenset(

Callers 1

Calls 5

splitrootFunction · 0.90
_get_bothsepsFunction · 0.85
casefoldMethod · 0.80
abspathFunction · 0.70
rstripMethod · 0.45

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…