mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-26 04:46:46 +08:00
Fix platform availability of some Unix constants (#10857)
This commit is contained in:
@@ -61,7 +61,8 @@ if sys.platform != "win32":
|
||||
A_DIM: int
|
||||
A_HORIZONTAL: int
|
||||
A_INVIS: int
|
||||
A_ITALIC: int
|
||||
if sys.platform != "darwin":
|
||||
A_ITALIC: int
|
||||
A_LEFT: int
|
||||
A_LOW: int
|
||||
A_NORMAL: int
|
||||
|
||||
@@ -70,9 +70,20 @@ if sys.platform != "win32":
|
||||
POSIX_FADV_WILLNEED: int
|
||||
POSIX_FADV_DONTNEED: int
|
||||
|
||||
SF_NODISKIO: int
|
||||
SF_MNOWAIT: int
|
||||
SF_SYNC: int
|
||||
if sys.platform != "linux" and sys.platform != "darwin":
|
||||
# In the os-module docs, these are marked as being available
|
||||
# on "Unix, not Emscripten, not WASI."
|
||||
# However, in the source code, a comment indicates they're "FreeBSD constants".
|
||||
# sys.platform could have one of many values on a FreeBSD Python build,
|
||||
# so the sys-module docs recommend doing `if sys.platform.startswith('freebsd')`
|
||||
# to detect FreeBSD builds. Unfortunately that would be too dynamic
|
||||
# for type checkers, however.
|
||||
SF_NODISKIO: int
|
||||
SF_MNOWAIT: int
|
||||
SF_SYNC: int
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
SF_NOCACHE: int
|
||||
|
||||
if sys.platform == "linux":
|
||||
XATTR_SIZE_MAX: int
|
||||
|
||||
@@ -137,7 +137,6 @@ if sys.platform == "linux":
|
||||
EPOLLRDNORM: int
|
||||
EPOLLWRBAND: int
|
||||
EPOLLWRNORM: int
|
||||
EPOLL_RDHUP: int
|
||||
EPOLL_CLOEXEC: int
|
||||
|
||||
if sys.platform != "linux" and sys.platform != "darwin" and sys.platform != "win32":
|
||||
|
||||
@@ -21,8 +21,6 @@ class Signals(IntEnum):
|
||||
CTRL_C_EVENT: int
|
||||
CTRL_BREAK_EVENT: int
|
||||
else:
|
||||
SIGEMT: int
|
||||
SIGINFO: int
|
||||
SIGALRM: int
|
||||
SIGBUS: int
|
||||
SIGCHLD: int
|
||||
@@ -47,6 +45,9 @@ class Signals(IntEnum):
|
||||
SIGWINCH: int
|
||||
SIGXCPU: int
|
||||
SIGXFSZ: int
|
||||
if sys.platform != "linux":
|
||||
SIGEMT: int
|
||||
SIGINFO: int
|
||||
if sys.platform != "darwin":
|
||||
SIGCLD: int
|
||||
SIGPOLL: int
|
||||
@@ -88,8 +89,9 @@ if sys.platform == "win32":
|
||||
CTRL_C_EVENT: Signals
|
||||
CTRL_BREAK_EVENT: Signals
|
||||
else:
|
||||
SIGINFO: Signals
|
||||
SIGEMT: Signals
|
||||
if sys.platform != "linux":
|
||||
SIGINFO: Signals
|
||||
SIGEMT: Signals
|
||||
SIGALRM: Signals
|
||||
SIGBUS: Signals
|
||||
SIGCHLD: Signals
|
||||
|
||||
Reference in New Issue
Block a user