diff options
author | Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp> | 2008-08-20 04:17:24 (GMT) |
---|---|---|
committer | Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp> | 2008-08-20 04:17:24 (GMT) |
commit | 5ef6d18bdf789f56dacd8efaa0b281c84180e1c2 (patch) | |
tree | 2c0237630fbb886bca998cb4db73007ae25bde08 /Lib/test/test_os.py | |
parent | 3938a90a4a8008b8ef6f26ee4b820ce146211001 (diff) | |
download | cpython-5ef6d18bdf789f56dacd8efaa0b281c84180e1c2.zip cpython-5ef6d18bdf789f56dacd8efaa0b281c84180e1c2.tar.gz cpython-5ef6d18bdf789f56dacd8efaa0b281c84180e1c2.tar.bz2 |
Merged revisions 65900 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r65900 | hirokazu.yamamoto | 2008-08-20 13:13:28 +0900 | 1 line
fixed get_file_system in test_os.py ('path' is unicode on py3k and ansi on trunk)
........
Diffstat (limited to 'Lib/test/test_os.py')
-rw-r--r-- | Lib/test/test_os.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index 3dffcb2..c566705 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -299,12 +299,15 @@ class StatAttributeTests(unittest.TestCase): # systems support centiseconds if sys.platform == 'win32': def get_file_system(path): - import os - root = os.path.splitdrive(os.path.realpath("."))[0] + '\\' + root = os.path.splitdrive(os.path.abspath(path))[0] + '\\' import ctypes - kernel32 = ctypes.windll.kernel32 - buf = ctypes.create_string_buffer("", 100) - if kernel32.GetVolumeInformationA(root, None, 0, None, None, None, buf, len(buf)): + 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) + buf = ctypes.create_unicode_buffer("", 100) + if f(root, None, 0, None, None, None, buf, len(buf)): return buf.value if get_file_system(support.TESTFN) == "NTFS": |