Skip to content

Commit 4ca20cc

Browse files
fix(pypi): handle missing short summaries on pypi packages (#732)
Signed-off-by: Zenith <me@arielle.codes> Co-authored-by: Kat <65649991+00-kat@users.noreply.github.com>
1 parent 2c60124 commit 4ca20cc

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

monty/exts/python/pypi.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -203,15 +203,12 @@ async def make_pypi_components(
203203
components[0].children.append(
204204
disnake.ui.TextDisplay(f"### [{info['name']} v{info['version']}]({info['package_url']})")
205205
)
206-
short_about = ""
207-
208-
summary = disnake.utils.escape_markdown(info["summary"])
209206

210207
# Summary could be completely empty, or just whitespace.
211-
if summary and not summary.isspace():
212-
short_about += f"{summary}"
208+
if (summary := info.get("summary")) and not summary.isspace():
209+
short_about = disnake.utils.escape_markdown(summary)
213210
else:
214-
short_about += "*No summary provided.*"
211+
short_about = "*No summary provided.*"
215212

216213
# add some padding
217214
if not with_description:

0 commit comments

Comments
 (0)