mirror of
https://github.com/saveweb/biliarchiver.git
synced 2024-09-19 11:05:28 -07:00
fix: get_free_space(): TypeError on Windows
This commit is contained in:
parent
da54602a58
commit
e8fb45d131
@ -14,7 +14,7 @@ def get_free_space(path: Union[Path,str]) -> int:
|
||||
raise FileNotFoundError(f'{path} File Not Found')
|
||||
if platform.system() == 'Windows':
|
||||
free_bytes = ctypes.c_ulonglong(0)
|
||||
ctypes.windll.kernel32.GetDiskFreeSpaceExW(ctypes.c_wchar_p(path), None, None, ctypes.pointer(free_bytes)) # type: ignore
|
||||
ctypes.windll.kernel32.GetDiskFreeSpaceExW(ctypes.c_wchar_p(os.path.abspath(path)), None, None, ctypes.pointer(free_bytes)) # type: ignore
|
||||
return free_bytes.value
|
||||
else:
|
||||
st = os.statvfs(path)
|
||||
|
Loading…
Reference in New Issue
Block a user