1- import sys
21from _typeshed import BytesPath , FileDescriptorOrPath , GenericPath , ReadableBuffer , StrOrBytesPath , StrPath
32from asyncio .events import AbstractEventLoop
43from collections .abc import Sequence
5- from os import _ScandirIterator , stat_result
4+ from os import _ScandirIterator , stat_result , statvfs_result
65from typing import Any , AnyStr , overload
76
87from aiofiles import ospath
@@ -11,6 +10,7 @@ from aiofiles.ospath import wrap as wrap
1110__all__ = [
1211 "path" ,
1312 "stat" ,
13+ "statvfs" ,
1414 "rename" ,
1515 "renames" ,
1616 "replace" ,
@@ -26,12 +26,10 @@ __all__ = [
2626 "listdir" ,
2727 "scandir" ,
2828 "access" ,
29+ "sendfile" ,
2930 "wrap" ,
3031]
3132
32- if sys .platform != "win32" :
33- __all__ += ["statvfs" , "sendfile" ]
34-
3533path = ospath
3634
3735async def stat (
@@ -118,25 +116,21 @@ async def listdir(path: int, *, loop: AbstractEventLoop | None = ..., executor:
118116async def access (
119117 path : FileDescriptorOrPath , mode : int , * , dir_fd : int | None = None , effective_ids : bool = False , follow_symlinks : bool = True
120118) -> bool : ...
121-
122- if sys .platform != "win32" :
123- from os import statvfs_result
124-
125- @overload
126- async def sendfile (
127- out_fd : int , in_fd : int , offset : int | None , count : int , * , loop : AbstractEventLoop | None = ..., executor : Any = ...
128- ) -> int : ...
129- @overload
130- async def sendfile (
131- out_fd : int ,
132- in_fd : int ,
133- offset : int ,
134- count : int ,
135- headers : Sequence [ReadableBuffer ] = ...,
136- trailers : Sequence [ReadableBuffer ] = ...,
137- flags : int = ...,
138- * ,
139- loop : AbstractEventLoop | None = ...,
140- executor : Any = ...,
141- ) -> int : ... # FreeBSD and Mac OS X only
142- async def statvfs (path : FileDescriptorOrPath ) -> statvfs_result : ... # Unix only
119+ @overload
120+ async def sendfile (
121+ out_fd : int , in_fd : int , offset : int | None , count : int , * , loop : AbstractEventLoop | None = ..., executor : Any = ...
122+ ) -> int : ...
123+ @overload
124+ async def sendfile (
125+ out_fd : int ,
126+ in_fd : int ,
127+ offset : int ,
128+ count : int ,
129+ headers : Sequence [ReadableBuffer ] = ...,
130+ trailers : Sequence [ReadableBuffer ] = ...,
131+ flags : int = ...,
132+ * ,
133+ loop : AbstractEventLoop | None = ...,
134+ executor : Any = ...,
135+ ) -> int : ... # FreeBSD and Mac OS X only
136+ async def statvfs (path : FileDescriptorOrPath ) -> statvfs_result : ... # Unix only
0 commit comments