@@ -1181,7 +1181,7 @@ async def start(
11811181 async_fn : Callable [..., Awaitable [object ]],
11821182 * args : object ,
11831183 name : object = None ,
1184- ) -> StatusT :
1184+ ) -> Any :
11851185 r"""Creates and initializes a child task.
11861186
11871187 Like :meth:`start_soon`, but blocks until the new task has
@@ -1230,7 +1230,7 @@ async def async_fn(arg1, arg2, *, task_status=trio.TASK_STATUS_IGNORED):
12301230 # `run` option, which would cause it to wrap a pre-started()
12311231 # exception in an extra ExceptionGroup. See #2611.
12321232 async with open_nursery (strict_exception_groups = False ) as old_nursery :
1233- task_status : _TaskStatus [StatusT ] = _TaskStatus (old_nursery , self )
1233+ task_status : _TaskStatus [Any ] = _TaskStatus (old_nursery , self )
12341234 thunk = functools .partial (async_fn , task_status = task_status )
12351235 task = GLOBAL_RUN_CONTEXT .runner .spawn_impl (
12361236 thunk , args , old_nursery , name
@@ -1243,7 +1243,7 @@ async def async_fn(arg1, arg2, *, task_status=trio.TASK_STATUS_IGNORED):
12431243 # (Any exceptions propagate directly out of the above.)
12441244 if task_status ._value is _NoStatus :
12451245 raise RuntimeError ("child exited without calling task_status.started()" )
1246- return task_status ._value # type: ignore[return-value] # Mypy doesn't narrow yet.
1246+ return task_status ._value
12471247 finally :
12481248 self ._pending_starts -= 1
12491249 self ._check_nursery_closed ()
0 commit comments