Skip to content

Commit 4b4d7cf

Browse files
SelmanBorayclaude
andcommitted
gh-161918: Correct the documented type of LogRecord's exc_info parameter
Records created by the logging methods can hold `(None, None, None)` (`exc_info=True` outside an `except` block) or a tuple whose traceback is `None` (an exception instance that was never raised). Widen the documented type to cover both. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
1 parent 910a92b commit 4b4d7cf

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎Doc/library/logging.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,7 @@ wire).
919919
:param exc_info: An exception tuple with the current exception information,
920920
as returned by :func:`sys.exc_info`,
921921
or ``None`` if no exception information is available.
922-
:type exc_info: tuple[type[BaseException], BaseException, types.TracebackType] | None
922+
:type exc_info: tuple[type[BaseException], BaseException, types.TracebackType | None] | tuple[None, None, None] | None
923923

924924
:param func: The name of the function or method
925925
from which the logging call was invoked.

0 commit comments

Comments
 (0)