Skip to content

Commit

Permalink
Ensure changeset.descname is a string when not None (#13150)
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner authored Nov 22, 2024
1 parent 697da6e commit ddd5aed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 1 addition & 4 deletions sphinx/builders/changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,7 @@ def write_documents(self, _docnames: Set[str]) -> None:
return
logger.info(bold(__('writing summary file...')))
for changeset in changesets:
if isinstance(changeset.descname, tuple):
descname = changeset.descname[0]
else:
descname = changeset.descname
descname = changeset.descname
ttext = self.typemap[changeset.type]
context = changeset.content.replace('\n', ' ')
if descname and changeset.docname.startswith('c-api'):
Expand Down
6 changes: 5 additions & 1 deletion sphinx/directives/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,11 @@ def run(self) -> list[Node]:

if self.names:
# needed for association of version{added,changed} directives
self.env.temp_data['object'] = self.names[0]
object_name: ObjDescT = self.names[0]
if isinstance(object_name, tuple):
self.env.temp_data['object'] = str(object_name[0])
else:
self.env.temp_data['object'] = str(object_name)
self.before_content()
content_children = self.parse_content_to_nodes(allow_section_headings=True)
content_node = addnodes.desc_content('', *content_children)
Expand Down

0 comments on commit ddd5aed

Please sign in to comment.