Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Lib/logging/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1680,6 +1680,8 @@ def _log(self, level, msg, args, exc_info=None, extra=None, stack_info=False,
exc_info = (type(exc_info), exc_info, exc_info.__traceback__)
elif not isinstance(exc_info, tuple):
exc_info = sys.exc_info()
else:
exc_info = None
record = self.makeRecord(self.name, level, fn, lno, msg, args,
exc_info, func, extra, sinfo)
self.handle(record)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
The log functions in the :mod:`logging` module and the
:class:`logging.Logger` class now normalize falsy ``exc_info`` arguments to
``None`` before passing them to :meth:`logging.Logger.makeRecord` and
subsequently to :class:`logging.LogRecord`. This aligns
``logging.LogRecord.exc_info`` with the documentation.
Loading