Skip to content

Commit d1a2c99

Browse files
committed
fix return type of trio/_core/_run to not be an awaitable, remove type: ignore
1 parent 2fd7ae4 commit d1a2c99

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

trio/_core/_run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2152,7 +2152,7 @@ def setup_runner(
21522152

21532153

21542154
def run(
2155-
async_fn: Callable[..., RetT],
2155+
async_fn: Callable[..., Awaitable[RetT]],
21562156
*args: object,
21572157
clock: Clock | None = None,
21582158
instruments: Sequence[Instrument] = (),

trio/testing/_trio_test.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ def wrapper(*args: ArgsT.args, **kwargs: ArgsT.kwargs) -> RetT:
4040
else:
4141
raise ValueError("too many clocks spoil the broth!")
4242
instruments = [i for i in kwargs.values() if isinstance(i, Instrument)]
43-
# trio.run isn't typed yet.
44-
return _core.run( # type: ignore[no-any-return]
43+
return _core.run(
4544
partial(fn, *args, **kwargs), clock=clock, instruments=instruments
4645
)
4746

0 commit comments

Comments
 (0)