8000 Update Lib/test/test_ntpath.py · python/cpython@1030d8a · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1030d8a

Browse files
mdboomeryksun
andauthored
Update Lib/test/test_ntpath.py
Co-authored-by: Eryk Sun <eryksun@gmail.com>
1 parent 9d4af5a commit 1030d8a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Lib/test/test_ntpath.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -892,8 +892,10 @@ def test_isjunction(self):
892892

893893
@unittest.skipIf(sys.platform != 'win32', "drive letters are a windows concept")
894894
def test_isfile_driveletter(self):
895-
current_drive = "\\\\.\\" + os.path.splitdrive(os.path.abspath(__file__))[0]
896-
self.assertFalse(os.path.isfile(current_drive))
895+
drive = os.environ.get('SystemDrive')
896+
if drive is None or len(drive) != 2 or drive[1] != ':':
897+
raise unittest.SkipTest('SystemDrive is not defined or malformed')
898+
self.assertFalse(os.path.isfile('\\\\.\\' + drive))
897899

898900
@unittest.skipIf(sys.platform != 'win32', "Fast paths are only for win32")
899901
@cpython_only

0 commit comments

Comments
 (0)
0