Skip to content

Commit f1f85ee

Browse files
authored
[stdlib] asyncio.Runner.run accepts Awaitables on Python 3.14+ (#15046)
1 parent ce2998f commit f1f85ee

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

stdlib/asyncio/runners.pyi

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import sys
22
from _typeshed import Unused
3-
from collections.abc import Callable, Coroutine
3+
from collections.abc import Awaitable, Callable, Coroutine
44
from contextvars import Context
55
from typing import Any, TypeVar, final
66
from typing_extensions import Self
@@ -22,7 +22,10 @@ if sys.version_info >= (3, 11):
2222
def __exit__(self, exc_type: Unused, exc_val: Unused, exc_tb: Unused) -> None: ...
2323
def close(self) -> None: ...
2424
def get_loop(self) -> AbstractEventLoop: ...
25-
def run(self, coro: Coroutine[Any, Any, _T], *, context: Context | None = None) -> _T: ...
25+
if sys.version_info >= (3, 14):
26+
def run(self, coro: Awaitable[_T], *, context: Context | None = None) -> _T: ...
27+
else:
28+
def run(self, coro: Coroutine[Any, Any, _T], *, context: Context | None = None) -> _T: ...
2629

2730
if sys.version_info >= (3, 12):
2831
def run(

0 commit comments

Comments
 (0)