From 81f8a10e9b6ae5258bfd10ac5cb102ac9ff53975 Mon Sep 17 00:00:00 2001 From: Jakub Kuczys Date: Tue, 6 Sep 2022 21:26:15 +0200 Subject: [PATCH] Update traceback.clear_frames() to accept None (#8695) `Exception.__traceback__` can potentially be None so for convenience (and because the simplest way of implementing it will allow it anyway), traceback.clear_frames() allows None. --- stdlib/traceback.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/traceback.pyi b/stdlib/traceback.pyi index fcaa39bf4..13e070e6d 100644 --- a/stdlib/traceback.pyi +++ b/stdlib/traceback.pyi @@ -92,7 +92,7 @@ else: def format_exc(limit: int | None = ..., chain: bool = ...) -> str: ... def format_tb(tb: TracebackType | None, limit: int | None = ...) -> list[str]: ... def format_stack(f: FrameType | None = ..., limit: int | None = ...) -> list[str]: ... -def clear_frames(tb: TracebackType) -> None: ... +def clear_frames(tb: TracebackType | None) -> None: ... def walk_stack(f: FrameType | None) -> Iterator[tuple[FrameType, int]]: ... def walk_tb(tb: TracebackType | None) -> Iterator[tuple[FrameType, int]]: ...