From f8ea76bb070188274ff347f4d500ec2657b8733b Mon Sep 17 00:00:00 2001 From: hauntsaninja <> Date: Mon, 21 Sep 2020 19:25:30 -0700 Subject: [PATCH] asyncio.run: fix type of debug Looks like my change to CPython broke typeshed --- stdlib/3/asyncio/runners.pyi | 7 +++++-- tests/stubtest_whitelists/py38.txt | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) 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