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.
This commit is contained in:
Jakub Kuczys
2022-09-06 21:26:15 +02:00
committed by GitHub
parent e2ef8fe116
commit 81f8a10e9b

View File

@@ -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]]: ...