Skip to content

Commit 3e6139f

Browse files
committed
Account for nodes without children in texinfo's ignores
This prevented compilation of the pytorch tutorial at https://github.com/pytorch/tutorials, with the latest master.
1 parent ac3f74a commit 3e6139f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sphinx/writers/texinfo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ def visit_reference(self, node: Element) -> None:
691691
# cases for the sake of appearance
692692
if isinstance(node.parent, (nodes.title, addnodes.desc_type)):
693693
return
694-
if isinstance(node[0], nodes.image):
694+
if len(node) != 0 and isinstance(node[0], nodes.image):
695695
return
696696
name = node.get('name', node.astext()).strip()
697697
uri = node.get('refuri', '')

0 commit comments

Comments
 (0)