mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #5326: manpage: crashed when invalid docname is specified as `man_pages
`
This commit is contained in:
parent
2371614227
commit
ee604144c6
3
CHANGES
3
CHANGES
@ -16,6 +16,9 @@ Features added
|
||||
Bugs fixed
|
||||
----------
|
||||
|
||||
* #5326: manpage: crashed when invalid docname is specified as ``man_pages``
|
||||
|
||||
|
||||
Testing
|
||||
--------
|
||||
|
||||
|
@ -18,6 +18,7 @@ from six import string_types
|
||||
from sphinx import addnodes
|
||||
from sphinx.builders import Builder
|
||||
from sphinx.environment import NoUri
|
||||
from sphinx.locale import __
|
||||
from sphinx.util import logging
|
||||
from sphinx.util.console import bold, darkgreen # type: ignore
|
||||
from sphinx.util.nodes import inline_all_toctrees
|
||||
@ -72,6 +73,10 @@ class ManualPageBuilder(Builder):
|
||||
|
||||
for info in self.config.man_pages:
|
||||
docname, name, description, authors, section = info
|
||||
if docname not in self.env.all_docs:
|
||||
logger.warning(__('"man_pages" config value references unknown '
|
||||
'document %s'), docname)
|
||||
continue
|
||||
if isinstance(authors, string_types):
|
||||
if authors:
|
||||
authors = [authors]
|
||||
|
Loading…
Reference in New Issue
Block a user