gh-117114: Make os.path.isdevdrive available on all platforms (GH-117115)

This commit is contained in:
Nice Zombies 2024-03-25 23:55:11 +01:00 committed by GitHub
parent c2276176d5
commit 0821923aa9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 39 additions and 57 deletions

View file

@ -35,7 +35,7 @@ __all__ = ["normcase","isabs","join","splitdrive","splitroot","split","splitext"
"samefile","sameopenfile","samestat",
"curdir","pardir","sep","pathsep","defpath","altsep","extsep",
"devnull","realpath","supports_unicode_filenames","relpath",
"commonpath", "isjunction"]
"commonpath", "isjunction","isdevdrive"]
def _get_sep(path):
@ -187,26 +187,6 @@ def dirname(p):
return head
# Is a path a junction?
def isjunction(path):
"""Test whether a path is a junction
Junctions are not a part of posix semantics"""
os.fspath(path)
return False
# Being true for dangling symbolic links is also useful.
def lexists(path):
"""Test whether a path exists. Returns True for broken symbolic links"""
try:
os.lstat(path)
except (OSError, ValueError):
return False
return True
# Is a path a mount point?
# (Does this work for all UNIXes? Is it even guaranteed to work by Posix?)