Skip to content

Commit

Permalink
Merge pull request #9334 from tk0miya/9322_KeyError_from_PropageteDes…
Browse files Browse the repository at this point in the history
…cDomain

Fix #9322: KeyError is raised on PropagateDescDomain transform
  • Loading branch information
tk0miya committed Jun 29, 2021
2 parents df5764d + 072cdf2 commit 723ad78
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -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
--------
Expand Down
3 changes: 2 additions & 1 deletion sphinx/transforms/post_transforms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand Down

0 comments on commit 723ad78

Please sign in to comment.