gh-104803: Implement ntpath.isdevdrive for checking whether a path is on a Windows Dev Drive (GH-104805)

This commit is contained in:
Steve Dower 2023-05-29 10:05:32 +01:00 committed by GitHub
parent e92ac0a741
commit bfd20d257e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 216 additions and 1 deletions

View file

@ -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