mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Return the default value for unsupported theme configuration sections
This commit is contained in:
parent
62c3bad0da
commit
4a0c9ddc7b
@ -7,7 +7,9 @@ Bugs fixed
|
||||
* #12299: Defer loading themes defined via entry points until
|
||||
their explicit use by the user or a child theme.
|
||||
Patch by Adam Turner.
|
||||
|
||||
* #12305: Return the default value for ``theme.get_config()`` with
|
||||
an unsupported theme configuration section.
|
||||
Patch by Adam Turner.
|
||||
|
||||
Release 7.3.6 (released Apr 17, 2024)
|
||||
=====================================
|
||||
|
@ -121,7 +121,17 @@ class Theme:
|
||||
elif section == 'options':
|
||||
value = self._options.get(name, default)
|
||||
else:
|
||||
value = _NO_DEFAULT
|
||||
# https://github.com/sphinx-doc/sphinx/issues/12305
|
||||
# For backwards compatibility when attempting to read a value
|
||||
# from an unsupported configuration section.
|
||||
# xref: RemovedInSphinx80Warning
|
||||
msg = __(
|
||||
'Theme configuration sections other than [theme] and [options] '
|
||||
'are not supported, returning the default value instead '
|
||||
'(tried to get a value from %r)'
|
||||
)
|
||||
logger.info(msg % section)
|
||||
value = default
|
||||
if value is _NO_DEFAULT:
|
||||
msg = __('setting %s.%s occurs in none of the searched theme configs') % (
|
||||
section,
|
||||
|
Loading…
Reference in New Issue
Block a user