From d75a47c2b7dec29dfcdfcafc0d7106c81d2610b5 Mon Sep 17 00:00:00 2001 From: funkyrailroad Date: Thu, 23 May 2024 10:44:41 -0400 Subject: [PATCH] Update BaseException and BaseExceptionGroup for 3.13 (#12010) --- stdlib/@tests/stubtest_allowlists/py313.txt | 6 ------ stdlib/builtins.pyi | 12 ++++++------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/stdlib/@tests/stubtest_allowlists/py313.txt b/stdlib/@tests/stubtest_allowlists/py313.txt index 1f4b708fa..f13eb48c1 100644 --- a/stdlib/@tests/stubtest_allowlists/py313.txt +++ b/stdlib/@tests/stubtest_allowlists/py313.txt @@ -113,12 +113,6 @@ asyncio.unix_events.__all__ bdb.Bdb.dispatch_opcode bdb.Bdb.set_stepinstr bdb.Bdb.user_opcode -builtins.BaseException.add_note -builtins.BaseException.with_traceback -builtins.BaseExceptionGroup.__class_getitem__ -builtins.BaseExceptionGroup.derive -builtins.BaseExceptionGroup.split -builtins.BaseExceptionGroup.subgroup builtins.ExceptionGroup.split builtins.ExceptionGroup.subgroup builtins.IncompleteInputError diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index ab73371e7..e8beea420 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -1844,11 +1844,11 @@ class BaseException: __traceback__: TracebackType | None def __init__(self, *args: object) -> None: ... def __setstate__(self, state: dict[str, Any] | None, /) -> None: ... - def with_traceback(self, tb: TracebackType | None, /) -> Self: ... + def with_traceback(self, object: TracebackType | None, /) -> Self: ... if sys.version_info >= (3, 11): # only present after add_note() is called __notes__: list[str] - def add_note(self, note: str, /) -> None: ... + def add_note(self, object: str, /) -> None: ... class GeneratorExit(BaseException): ... class KeyboardInterrupt(BaseException): ... @@ -2008,7 +2008,7 @@ if sys.version_info >= (3, 11): def exceptions(self) -> tuple[_BaseExceptionT_co | BaseExceptionGroup[_BaseExceptionT_co], ...]: ... @overload def subgroup( - self, condition: type[_ExceptionT] | tuple[type[_ExceptionT], ...], / + self, object: type[_ExceptionT] | tuple[type[_ExceptionT], ...], / ) -> ExceptionGroup[_ExceptionT] | None: ... @overload def subgroup( @@ -2020,7 +2020,7 @@ if sys.version_info >= (3, 11): ) -> BaseExceptionGroup[_BaseExceptionT_co] | None: ... @overload def split( - self, condition: type[_ExceptionT] | tuple[type[_ExceptionT], ...], / + self, object: type[_ExceptionT] | tuple[type[_ExceptionT], ...], / ) -> tuple[ExceptionGroup[_ExceptionT] | None, BaseExceptionGroup[_BaseExceptionT_co] | None]: ... @overload def split( @@ -2032,10 +2032,10 @@ if sys.version_info >= (3, 11): ) -> tuple[BaseExceptionGroup[_BaseExceptionT_co] | None, BaseExceptionGroup[_BaseExceptionT_co] | None]: ... # In reality it is `NonEmptySequence`: @overload - def derive(self, excs: Sequence[_ExceptionT], /) -> ExceptionGroup[_ExceptionT]: ... + def derive(self, object: Sequence[_ExceptionT], /) -> ExceptionGroup[_ExceptionT]: ... @overload def derive(self, excs: Sequence[_BaseExceptionT], /) -> BaseExceptionGroup[_BaseExceptionT]: ... - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... + def __class_getitem__(cls, object: Any, /) -> GenericAlias: ... class ExceptionGroup(BaseExceptionGroup[_ExceptionT_co], Exception): def __new__(cls, message: str, exceptions: Sequence[_ExceptionT_co], /) -> Self: ...