MCPcopy
hub / github.com/encode/starlette / create_collapsing_task_group

Function create_collapsing_task_group

starlette/_utils.py:83–93  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

81
82@asynccontextmanager
83async def create_collapsing_task_group() -> AsyncGenerator[anyio.abc.TaskGroup, None]:
84 try:
85 async with anyio.create_task_group() as tg:
86 yield tg
87 except BaseExceptionGroup as excs:
88 if len(excs.exceptions) != 1:
89 raise
90
91 exc = excs.exceptions[0]
92 context = None if exc.__suppress_context__ else exc.__context__
93 raise exc from exc.__cause__ or context
94
95
96def get_route_path(scope: Scope) -> str:

Callers 5

__call__Method · 0.90
__call__Method · 0.90
__call__Method · 0.90

Calls

no outgoing calls