Skip to content

Commit 5836a73

Browse files
committed
apply patch from @AA-Turner
Signed-off-by: William Woodruff <[email protected]>
1 parent 1def89a commit 5836a73

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

pep_sphinx_extensions/generate_rss.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,12 @@ def pep_abstract(document: nodes.document) -> str:
5959
if title_node is None:
6060
continue
6161

62-
para_node = None
6362
if title_node.astext() == "Abstract":
64-
para_node = node.next_node(nodes.paragraph)
65-
elif title_node.astext() == "Introduction":
66-
para_node = node.next_node(nodes.paragraph)
67-
68-
if para_node:
69-
introduction = para_node.astext().strip().replace("\n", " ")
63+
if (para_node := node.next_node(nodes.paragraph)) is not None:
64+
return para_node.astext().strip().replace("\n", " ")
65+
return ""
66+
if title_node.astext() == "Introduction":
67+
introduction = node.next_node(nodes.paragraph).astext().strip().replace("\n", " ")
7068

7169
return introduction
7270

0 commit comments

Comments
 (0)