Limit os.sendfile arguments based on platform (#10790)

This commit is contained in:
Amin Alaee
2023-09-28 13:36:25 +02:00
committed by GitHub
parent 24712f66a9
commit c6161f7108
5 changed files with 14 additions and 16 deletions

View File

@@ -657,18 +657,20 @@ if sys.platform != "win32":
RWF_SYNC: int
RWF_HIPRI: int
RWF_NOWAIT: int
@overload
def sendfile(out_fd: int, in_fd: int, offset: int | None, count: int) -> int: ...
@overload
def sendfile(
out_fd: int,
in_fd: int,
offset: int,
count: int,
headers: Sequence[ReadableBuffer] = ...,
trailers: Sequence[ReadableBuffer] = ...,
flags: int = 0,
) -> int: ... # FreeBSD and Mac OS X only
if sys.platform == "linux":
def sendfile(out_fd: FileDescriptor, in_fd: FileDescriptor, offset: int | None, count: int) -> int: ...
else:
def sendfile(
out_fd: FileDescriptor,
in_fd: FileDescriptor,
offset: int,
count: int,
headers: Sequence[ReadableBuffer] = ...,
trailers: Sequence[ReadableBuffer] = ...,
flags: int = 0,
) -> int: ... # FreeBSD and Mac OS X only
def readv(__fd: int, __buffers: SupportsLenAndGetItem[WriteableBuffer]) -> int: ...
def writev(__fd: int, __buffers: SupportsLenAndGetItem[ReadableBuffer]) -> int: ...

View File

@@ -1,5 +1,4 @@
_?curses.color_pair
(os|posix).sendfile
signal.sigtimedwait
signal.sigwaitinfo

View File

@@ -1,5 +1,4 @@
_?curses.color_pair
(os|posix).sendfile
signal.sigtimedwait
signal.sigwaitinfo
xxlimited.Xxo.x_exports

View File

@@ -1,6 +1,5 @@
_?curses.color_pair
_posixsubprocess.fork_exec
(os|posix).sendfile
(os|posix).setns
resource.prlimit
signal.sigtimedwait

View File

@@ -1,4 +1,3 @@
(os|posix).sendfile
select.epoll.register
# ==========