| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1680,6 +1680,8 @@ def _log(self, level, msg, args, exc_info=None, extra=None, stack_info=False, | |||
| 1680 | 1680 | exc_info = (type(exc_info), exc_info, exc_info.__traceback__) | |
| 1681 | 1681 | elif not isinstance(exc_info, tuple): | |
| 1682 | 1682 | exc_info = sys.exc_info() | |
| 1683 | + else: # Normalize any falsy value to None, for type precision | ||
| 1684 | + exc_info = None | ||
| 1683 | 1685 | record = self.makeRecord(self.name, level, fn, lno, msg, args, | |
| 1684 | 1686 | exc_info, func, extra, sinfo) | |
| 1685 | 1687 | self.handle(record) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,5 @@ | |||
| 1 | + The log functions in the :mod:`logging` module and the | ||
| 2 | + :class:`logging.Logger` class now normalize falsy ``exc_info`` arguments to | ||
| 3 | + ``None`` before passing them to :meth:`logging.Logger.makeRecord` and | ||
| 4 | + subsequently to :class:`logging.LogRecord`. This aligns | ||
| 5 | + ``logging.LogRecord.exc_info`` with the documentation. | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments