diff --git a/sphinx/directives/__init__.py b/sphinx/directives/__init__.py index c45232c92e7..4c92af67d9d 100644 --- a/sphinx/directives/__init__.py +++ b/sphinx/directives/__init__.py @@ -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']: diff --git a/sphinx/domains/changeset.py b/sphinx/domains/changeset.py index a27c5f571a8..abf622d5bb8 100644 --- a/sphinx/domains/changeset.py +++ b/sphinx/domains/changeset.py @@ -41,7 +41,7 @@ class ChangeSet(NamedTuple): docname: str lineno: int module: str | None - descname: str | None + descname: str content: str @@ -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)