Skip to content

Commit 7ff9c3a

Browse files
committed
Infra: Use simpler check for title in Discourse URL header processing
1 parent 1b65290 commit 7ff9c3a

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

pep_sphinx_extensions/pep_processor/transforms/pep_headers.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,7 @@ def _process_discourse_url(parts: list[str]) -> tuple[str, str]:
171171
f"{'/'.join(parts)} not a link to a Discourse thread or category")
172172

173173
first_subpart = parts[4]
174-
try:
175-
int(first_subpart)
176-
except ValueError:
177-
has_title = True
178-
else:
179-
has_title = False
174+
has_title = not first_subpart.isnumeric()
180175

181176
if "t" in parts:
182177
item_type = "post" if len(parts) > (5 + has_title) else "thread"

0 commit comments

Comments
 (0)