mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #3758: Sphinx crashed if logs are emitted in conf.py
This commit is contained in:
parent
957f78fd6a
commit
ec50d014ee
1
CHANGES
1
CHANGES
@ -15,6 +15,7 @@ Bugs fixed
|
||||
|
||||
* #3754: HTML builder crashes if HTML theme appends own stylesheets
|
||||
* #3756: epub: Entity 'mdash' not defined
|
||||
* #3758: Sphinx crashed if logs are emitted in conf.py
|
||||
|
||||
Testing
|
||||
--------
|
||||
|
@ -306,7 +306,13 @@ class WarningSuppressor(logging.Filter):
|
||||
type = getattr(record, 'type', None)
|
||||
subtype = getattr(record, 'subtype', None)
|
||||
|
||||
if is_suppressed_warning(type, subtype, self.app.config.suppress_warnings):
|
||||
try:
|
||||
suppress_warnings = self.app.config.suppress_warnings
|
||||
except AttributeError:
|
||||
# config is not initialized yet (ex. in conf.py)
|
||||
suppress_warnings = []
|
||||
|
||||
if is_suppressed_warning(type, subtype, suppress_warnings):
|
||||
return False
|
||||
else:
|
||||
self.app._warncount += 1
|
||||
|
Loading…
Reference in New Issue
Block a user