From 1f7b87b6b7d4c6271430bf1931b19179ef992f4e Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Mon, 6 Sep 2021 03:57:33 +0300 Subject: [PATCH] Adds more missing `ContextManager` types (#6007) 1. https://github.com/giampaolo/psutil/blob/c3e63b4dd59f1724a7fa29371e53dfa7f46cbcd3/psutil/_psbsd.py#L571 2. https://github.com/giampaolo/psutil/blob/c3e63b4dd59f1724a7fa29371e53dfa7f46cbcd3/psutil/_psosx.py#L365 --- stubs/psutil/psutil/_psbsd.pyi | 4 ++-- stubs/psutil/psutil/_psosx.pyi | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/stubs/psutil/psutil/_psbsd.pyi b/stubs/psutil/psutil/_psbsd.pyi index f61436c73..de3d5f2c9 100644 --- a/stubs/psutil/psutil/_psbsd.pyi +++ b/stubs/psutil/psutil/_psbsd.pyi @@ -1,4 +1,4 @@ -from typing import Any, NamedTuple +from typing import Any, ContextManager, NamedTuple from ._common import ( FREEBSD as FREEBSD, @@ -109,7 +109,7 @@ def pids(): ... def pid_exists(pid): ... def is_zombie(pid): ... def wrap_exceptions(fun): ... -def wrap_exceptions_procfs(inst) -> None: ... +def wrap_exceptions_procfs(inst) -> ContextManager[None]: ... class Process: pid: Any diff --git a/stubs/psutil/psutil/_psosx.pyi b/stubs/psutil/psutil/_psosx.pyi index cd828e436..7b09c463a 100644 --- a/stubs/psutil/psutil/_psosx.pyi +++ b/stubs/psutil/psutil/_psosx.pyi @@ -1,4 +1,4 @@ -from typing import Any, NamedTuple +from typing import Any, ContextManager, NamedTuple from ._common import ( AccessDenied as AccessDenied, @@ -71,7 +71,7 @@ pid_exists: Any def is_zombie(pid): ... def wrap_exceptions(fun): ... -def catch_zombie(proc) -> None: ... +def catch_zombie(proc) -> ContextManager[None]: ... class Process: pid: Any