Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Dec 17, 2024
1 parent 988f00b commit 35104c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions src/anyio/_backends/_asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
Any,
Optional,
TypeVar,
cast, Union,
Union,
cast,
)
from weakref import WeakKeyDictionary

Expand Down Expand Up @@ -692,9 +693,7 @@ def _extract_coro_from_task(self, key: Any) -> Coroutine[Any, Any, Any] | None:
if asyncio.iscoroutine(coro):
return coro
except Exception as exc:
raise RuntimeError(
"The task's coroutine was not available"
) from exc
raise RuntimeError("The task's coroutine was not available") from exc
return None

def __getitem__(self, key: TaskLike) -> TaskState:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_taskgroups.py
Original file line number Diff line number Diff line change
Expand Up @@ -1796,7 +1796,7 @@ async def test_nest_asyncio_applied():
nest_asyncio.apply()

async def coro_task():
await sleep(0)
await asyncio.lowlevel.checkpoint()

async with create_task_group() as tg:
tg.start_soon(coro_task)
Expand Down Expand Up @@ -1849,7 +1849,7 @@ def get_coro(self):
original_task = asyncio.Task

async def sample_coro():
await sleep(0)
await asyncio.lowlevel.checkpoint()

async def task_factory(loop, coro):
return CustomTask(coro)
Expand Down

0 comments on commit 35104c0

Please sign in to comment.