Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c6c2071

Browse files
[3.13] Doc: Strip trailing whitespace in pydoc_topics (GH-130492) (#130635)
(cherry picked from commit 3f3e1c4) Co-authored-by: Adam Turner <[email protected]>
1 parent 93b2bcb commit c6c2071

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)