Merge pull request #9334 from tk0miya/9322_KeyError_from_PropageteDescDomain

Fix sphinx-doc#9322: KeyError is raised on PropagateDescDomain transform
This commit is contained in:
Takeshi KOMIYA 2021-06-30 00:06:57 +09:00 committed by GitHub
commit 723ad78306
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -27,6 +27,7 @@ Bugs fixed
with Japanese engines
* #9354: C, remove special macro names from the keyword list.
See also :confval:`c_extra_keywords`.
* #9322: KeyError is raised on PropagateDescDomain transform
Testing
--------

View File

@ -249,7 +249,8 @@ class PropagateDescDomain(SphinxPostTransform):
def run(self, **kwargs: Any) -> None:
for node in self.document.traverse(addnodes.desc_signature):
node['classes'].append(node.parent['domain'])
if node.parent.get('domain'):
node['classes'].append(node.parent['domain'])
def setup(app: Sphinx) -> Dict[str, Any]: