mirror of
https://github.com/python/cpython.git
synced 2025-08-27 12:16:04 +00:00
gh-117114: Make os.path.isdevdrive available on all platforms (GH-117115)
This commit is contained in:
parent
c2276176d5
commit
0821923aa9
5 changed files with 39 additions and 57 deletions
|
@ -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?)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue