mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-104803: Implement ntpath.isdevdrive for checking whether a path is on a Windows Dev Drive (GH-104805)
This commit is contained in:
parent
e92ac0a741
commit
bfd20d257e
6 changed files with 216 additions and 1 deletions
|
@ -867,3 +867,19 @@ try:
|
|||
except ImportError:
|
||||
# Use genericpath.* as imported above
|
||||
pass
|
||||
|
||||
|
||||
try:
|
||||
from nt import _path_isdevdrive
|
||||
except ImportError:
|
||||
def isdevdrive(path):
|
||||
"""Determines whether the specified path is on a Windows Dev Drive."""
|
||||
# Never a Dev Drive
|
||||
return False
|
||||
else:
|
||||
def isdevdrive(path):
|
||||
"""Determines whether the specified path is on a Windows Dev Drive."""
|
||||
try:
|
||||
return _path_isdevdrive(abspath(path))
|
||||
except OSError:
|
||||
return False
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue