Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/anyio/_core/_resources.py: 50%
6 statements
« prev ^ index » next coverage.py v7.2.2, created at 2023-03-26 06:12 +0000
« prev ^ index » next coverage.py v7.2.2, created at 2023-03-26 06:12 +0000
1from ..abc import AsyncResource
2from ._tasks import CancelScope
5async def aclose_forcefully(resource: AsyncResource) -> None:
6 """
7 Close an asynchronous resource in a cancelled scope.
9 Doing this closes the resource without waiting on anything.
11 :param resource: the resource to close
13 """
14 with CancelScope() as scope:
15 scope.cancel()
16 await resource.aclose()