Reduce use of deprecated typing aliases (#6358)

This commit is contained in:
Alex Waygood
2021-11-23 09:56:43 +00:00
committed by GitHub
parent 7e836db2f3
commit c685c2d6c6
19 changed files with 64 additions and 61 deletions

View File

@@ -1,5 +1,6 @@
import sys
from typing import Any, Callable, ContextManager, Iterable, Iterator, Tuple, TypeVar
from contextlib import AbstractContextManager
from typing import Any, Callable, Iterable, Iterator, Tuple, TypeVar
from ._common import (
AIX as AIX,
@@ -122,7 +123,7 @@ class Process:
def __hash__(self) -> int: ...
@property
def pid(self) -> int: ...
def oneshot(self) -> ContextManager[None]: ...
def oneshot(self) -> AbstractContextManager[None]: ...
def as_dict(
self, attrs: list[str] | Tuple[str, ...] | set[str] | frozenset[str] | None = ..., ad_value: Any | None = ...
) -> dict[str, Any]: ...

View File

@@ -1,4 +1,5 @@
from typing import Any, ContextManager, NamedTuple
from contextlib import AbstractContextManager
from typing import Any, NamedTuple
from ._common import (
FREEBSD as FREEBSD,
@@ -109,7 +110,7 @@ def pids(): ...
def pid_exists(pid): ...
def is_zombie(pid): ...
def wrap_exceptions(fun): ...
def wrap_exceptions_procfs(inst) -> ContextManager[None]: ...
def wrap_exceptions_procfs(inst) -> AbstractContextManager[None]: ...
class Process:
pid: Any

View File

@@ -1,4 +1,5 @@
from typing import Any, ContextManager, NamedTuple
from contextlib import AbstractContextManager
from typing import Any, NamedTuple
from ._common import (
AccessDenied as AccessDenied,
@@ -71,7 +72,7 @@ pid_exists: Any
def is_zombie(pid): ...
def wrap_exceptions(fun): ...
def catch_zombie(proc) -> ContextManager[None]: ...
def catch_zombie(proc) -> AbstractContextManager[None]: ...
class Process:
pid: Any