Skip to content

Commit

Permalink
typing.[Async]ContextManager -> contextlib.Abstract[Async]ContextManager
Browse files Browse the repository at this point in the history
  • Loading branch information
jakkdl committed Jun 26, 2023
1 parent 71d333e commit 421f46f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 3 additions & 2 deletions trio/_core/_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
from heapq import heapify, heappop, heappush
from math import inf
from time import perf_counter
from typing import TYPE_CHECKING, Any, NoReturn, TypeVar, AsyncContextManager
from typing import TYPE_CHECKING, Any, NoReturn, TypeVar
from types import TracebackType
from collections.abc import Iterator
from contextlib import AbstractAsyncContextManager

import attr
from outcome import Error, Outcome, Value, capture
Expand Down Expand Up @@ -899,7 +900,7 @@ def __exit__(self): # pragma: no cover

def open_nursery(
strict_exception_groups: bool | None = None,
) -> AsyncContextManager[Nursery]:
) -> AbstractAsyncContextManager[Nursery]:
"""Returns an async context manager which must be used to create a
new `Nursery`.
Expand Down
5 changes: 2 additions & 3 deletions trio/_timeouts.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import math
from contextlib import contextmanager
from typing import ContextManager
from contextlib import contextmanager, AbstractContextManager
from collections.abc import Iterator

import trio
Expand Down Expand Up @@ -122,7 +121,7 @@ def fail_at(deadline: float) -> Iterator[trio.CancelScope]:
raise TooSlowError


def fail_after(seconds: float) -> ContextManager[trio.CancelScope]:
def fail_after(seconds: float) -> AbstractContextManager[trio.CancelScope]:
"""Creates a cancel scope with the given timeout, and raises an error if
it is actually cancelled.
Expand Down

0 comments on commit 421f46f

Please sign in to comment.