Test whether a path is a mount point (a drive root, the root of a share, or a mounted volume)
(path)
| 288 | except ImportError: |
| 289 | _getvolumepathname = None |
| 290 | def ismount(path): |
| 291 | """Test whether a path is a mount point (a drive root, the root of a |
| 292 | share, or a mounted volume)""" |
| 293 | path = os.fspath(path) |
| 294 | seps = _get_bothseps(path) |
| 295 | path = abspath(path) |
| 296 | root, rest = splitdrive(path) |
| 297 | if root and root[0] in seps: |
| 298 | return (not rest) or (rest in seps) |
| 299 | if rest and rest in seps: |
| 300 | return True |
| 301 | |
| 302 | if _getvolumepathname: |
| 303 | x = path.rstrip(seps) |
| 304 | y =_getvolumepathname(path).rstrip(seps) |
| 305 | return x.casefold() == y.casefold() |
| 306 | else: |
| 307 | return False |
| 308 | |
| 309 | |
| 310 | # Expand paths beginning with '~' or '~user'. |
nothing calls this directly
no test coverage detected