diff --git a/stdlib/os/__init__.pyi b/stdlib/os/__init__.pyi index 77c002659..2ea374873 100644 --- a/stdlib/os/__init__.pyi +++ b/stdlib/os/__init__.pyi @@ -308,7 +308,8 @@ if sys.platform != "win32": EX_NOPERM: int EX_CONFIG: int -if sys.platform != "win32" and sys.platform != "darwin": +# Exists on some Unix platforms, e.g. Solaris. +if sys.platform != "win32" and sys.platform != "darwin" and sys.platform != "linux": EX_NOTFOUND: int P_NOWAIT: int diff --git a/stdlib/posix.pyi b/stdlib/posix.pyi index 6cba003bb..b31b8f3d3 100644 --- a/stdlib/posix.pyi +++ b/stdlib/posix.pyi @@ -239,9 +239,11 @@ if sys.platform != "win32": if sys.platform != "linux": from os import chflags as chflags, lchflags as lchflags, lchmod as lchmod + if sys.platform != "linux" and sys.platform != "darwin": + from os import EX_NOTFOUND as EX_NOTFOUND + if sys.platform != "darwin": from os import ( - EX_NOTFOUND as EX_NOTFOUND, POSIX_FADV_DONTNEED as POSIX_FADV_DONTNEED, POSIX_FADV_NOREUSE as POSIX_FADV_NOREUSE, POSIX_FADV_NORMAL as POSIX_FADV_NORMAL, diff --git a/tests/stubtest_allowlists/linux.txt b/tests/stubtest_allowlists/linux.txt index 0d3ff2879..924546b77 100644 --- a/tests/stubtest_allowlists/linux.txt +++ b/tests/stubtest_allowlists/linux.txt @@ -41,10 +41,6 @@ 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_]+