diff --git a/stdlib/3/asyncio/runners.pyi b/stdlib/3/asyncio/runners.pyi index 0293fd9b133a..1628cb3e89f1 100644 --- a/stdlib/3/asyncio/runners.pyi +++ b/stdlib/3/asyncio/runners.pyi @@ -1,7 +1,10 @@ import sys if sys.version_info >= (3, 7): - from typing import Awaitable, TypeVar + from typing import Awaitable, Optional, TypeVar _T = TypeVar("_T") - def run(main: Awaitable[_T], *, debug: bool = ...) -> _T: ... + if sys.version_info >= (3, 8): + def run(main: Awaitable[_T], *, debug: Optional[bool] = ...) -> _T: ... + else: + def run(main: Awaitable[_T], *, debug: bool = ...) -> _T: ... diff --git a/tests/stubtest_whitelists/py38.txt b/tests/stubtest_whitelists/py38.txt index b3b48d0cb1ff..d2a5f329a6f0 100644 --- a/tests/stubtest_whitelists/py38.txt +++ b/tests/stubtest_whitelists/py38.txt @@ -13,6 +13,8 @@ asyncio.events.AbstractEventLoop.sock_sendfile asyncio.futures.Future.__init__ asyncio.futures.Future._callbacks asyncio.proactor_events._ProactorBasePipeTransport.__del__ +asyncio.run # Bugfix involving this was backported to 3.8 +asyncio.runners.run # It just hasn't been released yet asyncio.threads # Added in Python 3.9 builtins.dict.get collections.AsyncGenerator.ag_await