]> granicus.if.org Git - python/commitdiff
Reverted r65901 and uses GetVolumeInformationW because string in py3k is unicode.
authorHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>
Wed, 20 Aug 2008 16:18:19 +0000 (16:18 +0000)
committerHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>
Wed, 20 Aug 2008 16:18:19 +0000 (16:18 +0000)
See http://mail.python.org/pipermail/python-checkins/2008-August/073116.html

Lib/test/test_os.py

index c5667054046599b0f8eadf8ed842c2bf463caffb..e9b0652ab0dc737f07b4bbf5f03fb46e26a57a97 100644 (file)
@@ -301,13 +301,9 @@ class StatAttributeTests(unittest.TestCase):
         def get_file_system(path):
             root = os.path.splitdrive(os.path.abspath(path))[0] + '\\'
             import ctypes
-            from ctypes.wintypes import LPCWSTR, LPWSTR, DWORD
-            LPDWORD = ctypes.POINTER(DWORD)
-            f = ctypes.windll.kernel32.GetVolumeInformationW
-            f.argtypes = (LPCWSTR, LPWSTR, DWORD,
-                LPDWORD, LPDWORD, LPDWORD, LPWSTR, DWORD)
+            kernel32 = ctypes.windll.kernel32
             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
 
         if get_file_system(support.TESTFN) == "NTFS":