Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ca765d5

Browse files
author
Hirokazu Yamamoto
committed
Reverted r65901 and uses GetVolumeInformationW because string in py3k is unicode.
See http://mail.python.org/pipermail/python-checkins/2008-August/073116.html
1 parent 87c6244 commit ca765d5

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

Lib/test/test_os.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -301,13 +301,9 @@ def test_utime_dir(self):
301301
def get_file_system(path):
302302
root = os.path.splitdrive(os.path.abspath(path))[0] + '\\'
303303
import ctypes
304-
from ctypes.wintypes import LPCWSTR, LPWSTR, DWORD
305-
LPDWORD = ctypes.POINTER(DWORD)
306-
f = ctypes.windll.kernel32.GetVolumeInformationW
307-
f.argtypes = (LPCWSTR, LPWSTR, DWORD,
308-
LPDWORD, LPDWORD, LPDWORD, LPWSTR, DWORD)
304+
kernel32 = ctypes.windll.kernel32
309305
buf = ctypes.create_unicode_buffer("", 100)
310-
if f(root, None, 0, None, None, None, buf, len(buf)):
306+
if kernel32.GetVolumeInformationW(root, None, 0, None, None, None, buf, len(buf)):
311307
return buf.value
312308

313309
if get_file_system(support.TESTFN) == "NTFS":

0 commit comments

Comments
 (0)