Fix platform availability of some os/posix constants (#10831)

This commit is contained in:
Nikita Sobolev
2023-10-03 17:20:00 +03:00
committed by GitHub
parent ff520ca9f2
commit cc5b3f8bc4
4 changed files with 10 additions and 7 deletions

View File

@@ -282,6 +282,8 @@ if sys.platform != "win32":
EX_PROTOCOL: int
EX_NOPERM: int
EX_CONFIG: int
if sys.platform != "win32" and sys.platform != "darwin":
EX_NOTFOUND: int
P_NOWAIT: int

View File

@@ -14,7 +14,6 @@ if sys.platform != "win32":
EX_NOHOST as EX_NOHOST,
EX_NOINPUT as EX_NOINPUT,
EX_NOPERM as EX_NOPERM,
EX_NOTFOUND as EX_NOTFOUND,
EX_NOUSER as EX_NOUSER,
EX_OK as EX_OK,
EX_OSERR as EX_OSERR,
@@ -29,6 +28,7 @@ if sys.platform != "win32":
F_TEST as F_TEST,
F_TLOCK as F_TLOCK,
F_ULOCK as F_ULOCK,
NGROUPS_MAX as NGROUPS_MAX,
O_APPEND as O_APPEND,
O_ASYNC as O_ASYNC,
O_CREAT as O_CREAT,
@@ -222,6 +222,9 @@ if sys.platform != "win32":
writev as writev,
)
if sys.platform != "darwin":
from os import EX_NOTFOUND as EX_NOTFOUND
if sys.platform == "linux":
from os import (
GRND_NONBLOCK as GRND_NONBLOCK,

View File

@@ -1,12 +1,10 @@
_?curses.A_ITALIC
_posixsubprocess.cloexec_pipe
os.EX_NOTFOUND
os.SF_MNOWAIT
os.SF_NODISKIO
os.SF_SYNC
(os|posix).sched_param # system dependent. Unclear if macos has it.
posix.EX_NOTFOUND
select.KQ_FILTER_NETDEV # system dependent
select.kqueue.__init__ # default C signature is wrong
select.POLLMSG # system dependent
@@ -33,7 +31,6 @@ _ctypes.dlclose
_ctypes.dlopen
_ctypes.dlsym
posix.NGROUPS_MAX
webbrowser.MacOSX.__init__
# ==========

View File

@@ -1,12 +1,9 @@
_socket.*
_posixsubprocess.cloexec_pipe
os.EX_NOTFOUND
os.SF_MNOWAIT
os.SF_NODISKIO
os.SF_SYNC
os.plock
posix.EX_NOTFOUND
posix.NGROUPS_MAX
select.EPOLL_RDHUP
selectors.KqueueSelector
signal.SIGEMT
@@ -48,6 +45,10 @@ fcntl.I_[A-Z0-9_]+
os.SCHED_[A-Z_]+
posix.SCHED_[A-Z_]+
# Exists on some Unix platforms, but not in CI:
os.EX_NOTFOUND
posix.EX_NOTFOUND
# Some of these exist on non-windows, but they are useless and this is not intended
stat.FILE_ATTRIBUTE_[A-Z_]+