diff --git a/stdlib/VERSIONS b/stdlib/VERSIONS index 1d48a312abf4..d396ce4d0560 100644 --- a/stdlib/VERSIONS +++ b/stdlib/VERSIONS @@ -173,6 +173,7 @@ modulefinder: 2.7- msilib: 2.7- msvcrt: 2.7- multiprocessing: 2.7- +multiprocessing.resource_tracker: 3.8- multiprocessing.shared_memory: 3.8- netrc: 2.7- nis: 2.7- diff --git a/stdlib/multiprocessing/resource_tracker.pyi b/stdlib/multiprocessing/resource_tracker.pyi new file mode 100644 index 000000000000..98abb075fb3d --- /dev/null +++ b/stdlib/multiprocessing/resource_tracker.pyi @@ -0,0 +1,19 @@ +from _typeshed import Incomplete, StrOrBytesPath +from collections.abc import Sized + +__all__ = ["ensure_running", "register", "unregister"] + +class ResourceTracker: + def __init__(self) -> None: ... + def getfd(self) -> int | None: ... + def ensure_running(self) -> None: ... + def register(self, name: Sized, rtype: Incomplete) -> None: ... + def unregister(self, name: Sized, rtype: Incomplete) -> None: ... + +_resource_tracker: ResourceTracker = ... +ensure_running = _resource_tracker.ensure_running +register = _resource_tracker.register +unregister = _resource_tracker.unregister +getfd = _resource_tracker.getfd + +def main(fd: StrOrBytesPath | int) -> None: ...