Fix msg parameter type for asyncio Future.cancel() and Task.cancel() (#5999)

This commit is contained in:
Andrew Svetlov
2021-09-03 19:07:20 +03:00
committed by GitHub
parent ffaa0ea3d1
commit c0030b2b12
2 changed files with 2 additions and 2 deletions

View File

@@ -45,7 +45,7 @@ class Future(Awaitable[_T], Iterable[_T]):
def _callbacks(self: _S) -> list[Callable[[_S], Any]]: ...
def add_done_callback(self: _S, __fn: Callable[[_S], Any]) -> None: ...
if sys.version_info >= (3, 9):
def cancel(self, msg: str | None = ...) -> bool: ...
def cancel(self, msg: Any | None = ...) -> bool: ...
else:
def cancel(self) -> bool: ...
def cancelled(self) -> bool: ...

View File

@@ -271,7 +271,7 @@ class Task(Future[_T], Generic[_T]):
def get_stack(self, *, limit: int | None = ...) -> list[FrameType]: ...
def print_stack(self, *, limit: int | None = ..., file: TextIO | None = ...) -> None: ...
if sys.version_info >= (3, 9):
def cancel(self, msg: str | None = ...) -> bool: ...
def cancel(self, msg: Any | None = ...) -> bool: ...
else:
def cancel(self) -> bool: ...
if sys.version_info < (3, 9):