diff options
Diffstat (limited to 'sphinx/util/logging.py')
| -rw-r--r-- | sphinx/util/logging.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sphinx/util/logging.py b/sphinx/util/logging.py index 64b7d8fb4..e0f4f0e70 100644 --- a/sphinx/util/logging.py +++ b/sphinx/util/logging.py @@ -320,8 +320,8 @@ def prefixed_warnings(prefix: str) -> Generator[None, None, None]: prefix_filter.prefix = previous else: # not prefixed yet + prefix_filter = MessagePrefixFilter(prefix) try: - prefix_filter = MessagePrefixFilter(prefix) warning_handler.addFilter(prefix_filter) yield finally: @@ -472,7 +472,7 @@ class SphinxLogRecordTranslator(logging.Filter): * Make a instance of SphinxLogRecord * docname to path if location given """ - LogRecordClass: Type[logging.LogRecord] = None + LogRecordClass: Type[logging.LogRecord] def __init__(self, app: "Sphinx") -> None: self.app = app |
