Skip to content

Commit 3f3e1c4

Browse files
authored
Doc: Strip trailing whitespace in pydoc_topics (#130492)
1 parent 45bc120 commit 3f3e1c4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Doc/tools/extensions/pydoc_topics.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ def write_documents(self, _docnames: Set[str]) -> None:
143143
document.append(doc_ids[label_id])
144144
visitor = TextTranslator(document, builder=self)
145145
document.walkabout(visitor)
146-
self.topics[topic_label] = visitor.body
146+
body = "\n".join(map(str.rstrip, visitor.body.splitlines()))
147+
self.topics[topic_label] = body
147148

148149
def finish(self) -> None:
149150
topics_repr = "\n".join(

0 commit comments

Comments
 (0)