mirror of
https://github.com/python/cpython.git
synced 2025-10-23 07:02:24 +00:00
Reverted r65901 and uses GetVolumeInformationW because string in py3k is unicode.
See http://mail.python.org/pipermail/python-checkins/2008-August/073116.html
This commit is contained in:
parent
87c624421f
commit
ca765d5828
1 changed files with 2 additions and 6 deletions
|
@ -301,13 +301,9 @@ class StatAttributeTests(unittest.TestCase):
|
||||||
def get_file_system(path):
|
def get_file_system(path):
|
||||||
root = os.path.splitdrive(os.path.abspath(path))[0] + '\\'
|
root = os.path.splitdrive(os.path.abspath(path))[0] + '\\'
|
||||||
import ctypes
|
import ctypes
|
||||||
from ctypes.wintypes import LPCWSTR, LPWSTR, DWORD
|
kernel32 = ctypes.windll.kernel32
|
||||||
LPDWORD = ctypes.POINTER(DWORD)
|
|
||||||
f = ctypes.windll.kernel32.GetVolumeInformationW
|
|
||||||
f.argtypes = (LPCWSTR, LPWSTR, DWORD,
|
|
||||||
LPDWORD, LPDWORD, LPDWORD, LPWSTR, DWORD)
|
|
||||||
buf = ctypes.create_unicode_buffer("", 100)
|
buf = ctypes.create_unicode_buffer("", 100)
|
||||||
if f(root, None, 0, None, None, None, buf, len(buf)):
|
if kernel32.GetVolumeInformationW(root, None, 0, None, None, None, buf, len(buf)):
|
||||||
return buf.value
|
return buf.value
|
||||||
|
|
||||||
if get_file_system(support.TESTFN) == "NTFS":
|
if get_file_system(support.TESTFN) == "NTFS":
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue