Skip to content

Commit c7ac503

Browse files
[3.12] Doc: Strip trailing whitespace in pydoc_topics (GH-130492) (#130636)
(cherry picked from commit 3f3e1c4) Co-authored-by: Adam Turner <[email protected]>
1 parent fb073b5 commit c7ac503

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Doc/tools/extensions/pydoc_topics.py

+2-1
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)