Skip to content

Commit 067469a

Browse files
AA-Turnermiss-islington
authored andcommitted
Doc: Strip trailing whitespace in pydoc_topics (GH-130492)
(cherry picked from commit 3f3e1c4) Co-authored-by: Adam Turner <[email protected]>
1 parent fb073b5 commit 067469a

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
@@ -142,7 +142,8 @@ def write_documents(self, _docnames: Set[str]) -> None:
142142
document.append(doc_ids[label_id])
143143
visitor = TextTranslator(document, builder=self)
144144
document.walkabout(visitor)
145-
self.topics[topic_label] = visitor.body
145+
body = "\n".join(map(str.rstrip, visitor.body.splitlines()))
146+
self.topics[topic_label] = body
146147

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

0 commit comments

Comments
 (0)