Skip to content

Commit

Permalink
Narrow the type of ChangeSet.descname to str
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner committed Nov 22, 2024
1 parent 3cfccf3 commit f5d4ebd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion sphinx/directives/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ def run(self) -> list[Node]:
'object-description-transform', self.domain, self.objtype, content_node
)
DocFieldTransformer(self).transform_all(content_node)
self.env.temp_data['object'] = None
self.env.temp_data['object'] = ''
self.after_content()

if node['no-typesetting']:
Expand Down
4 changes: 2 additions & 2 deletions sphinx/domains/changeset.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class ChangeSet(NamedTuple):
docname: str
lineno: int
module: str | None
descname: str | None
descname: str
content: str


Expand Down Expand Up @@ -123,7 +123,7 @@ def changesets(self) -> dict[str, list[ChangeSet]]:
def note_changeset(self, node: addnodes.versionmodified) -> None:
version = node['version']
module = self.env.ref_context.get('py:module')
objname = self.env.temp_data.get('object')
objname = self.env.temp_data.get('object', '')
changeset = ChangeSet(node['type'], self.env.docname, node.line, # type: ignore[arg-type]
module, objname, node.astext())
self.changesets.setdefault(version, []).append(changeset)
Expand Down

0 comments on commit f5d4ebd

Please sign in to comment.