diff --git a/stubs/psutil/psutil/__init__.pyi b/stubs/psutil/psutil/__init__.pyi index 6c4fda89160f..0252546653c9 100644 --- a/stubs/psutil/psutil/__init__.pyi +++ b/stubs/psutil/psutil/__init__.pyi @@ -459,7 +459,13 @@ def cpu_stats() -> _ntp.scpustats: ... def getloadavg() -> tuple[float, float, float]: ... def virtual_memory() -> _ntp.svmem: ... def swap_memory() -> _ntp.sswap: ... -def disk_usage(path: str) -> _ntp.sdiskusage: ... + +if sys.platform == "win32": + def disk_usage(path: str | bytes) -> _ntp.sdiskusage: ... + +else: + def disk_usage(path: StrOrBytesPath) -> _ntp.sdiskusage: ... + def disk_partitions(all: bool = False) -> list[_ntp.sdiskpart]: ... # TODO: Incorrect sdiskio for BSD systems: