From 5820dad6418dbf5b119f4b09c8747e2039b38f27 Mon Sep 17 00:00:00 2001 From: Pranav Rajpal <78008260+pranavrajpal@users.noreply.github.com> Date: Sun, 29 May 2022 19:17:01 -0700 Subject: [PATCH] Add __setstate__ for BaseException BaseException has a __setstate__ method at runtime that sets __dict__ to the passed in parameter. --- stdlib/builtins.pyi | 1 + 1 file changed, 1 insertion(+) diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index 53b3cdd06042..f91cb674c3ca 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -1678,6 +1678,7 @@ class BaseException: __suppress_context__: bool __traceback__: TracebackType | None def __init__(self, *args: object) -> None: ... + def __setstate__(self, __state: dict[str, Any] | None) -> None: ... def with_traceback(self: Self, __tb: TracebackType | None) -> Self: ... if sys.version_info >= (3, 11): # only present after add_note() is called