10000 Add several missing stdlib functions by not-my-profile · Pull Request #7397 · python/typeshed · GitHub
[go: up one dir, main page]

Skip to content

Add several missing stdlib functions #7397

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Mar 6, 2022
Merged
Prev Previous commit
Next Next commit
stdlib: Add os.pidfd_open(pid)
  • Loading branch information
not-my-profile committed Mar 2, 2022
commit 0fed369649dcb47a2adc12b565e5bc78df471848
3 changes: 3 additions & 0 deletions stdlib/os/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1022,3 +1022,6 @@ if sys.version_info >= (3, 8):

if sys.version_info >= (3, 9):
def waitstatus_to_exitcode(status: int) -> int: ...

if sys.platform == "linux":
def pidfd_open(pid: int, flags: int = ...) -> int: ...
3 changes: 2 additions & 1 deletion stdlib/posix.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,8 @@ if sys.platform != "win32":
from os import CLD_KILLED as CLD_KILLED, CLD_STOPPED as CLD_STOPPED, waitstatus_to_exitcode as waitstatus_to_exitcode

if sys.platform == "linux":
from os import P_PIDFD as P_PIDFD
from os import P_PIDFD as P_PIDFD, pidfd_open as pidfd_open

if sys.version_info >= (3, 8):
from os import (
POSIX_SPAWN_CLOSE as POSIX_SPAWN_CLOSE,
Expand Down
2 changes: 0 additions & 2 deletions tests/stubtest_allowlists/linux-py310.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,11 @@ os.copy_file_range
os.eventfd
os.eventfd_read
os.eventfd_write
os.pidfd_open
os.splice
posix.EFD_[A-Z]+
posix.SPLICE_[A-Z_]+
posix.copy_file_range
posix.eventfd
posix.eventfd_read
posix.eventfd_write
posix.pidfd_open
posix.splice
2 changes: 0 additions & 2 deletions tests/stubtest_allowlists/linux-py39.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@ select.epoll.register

# Exists at runtime, but missing from stubs
os.copy_file_range
os.pidfd_open
posix.copy_file_range
posix.pidfd_open
0