From 7ff9c3aefcc8884db650faf97303007728afec2b Mon Sep 17 00:00:00 2001 From: "C.A.M. Gerlach" Date: Sat, 26 Mar 2022 22:58:21 -0500 Subject: [PATCH] Infra: Use simpler check for title in Discourse URL header processing --- .../pep_processor/transforms/pep_headers.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/pep_sphinx_extensions/pep_processor/transforms/pep_headers.py b/pep_sphinx_extensions/pep_processor/transforms/pep_headers.py index 2b4cc5d0766f..323d7413e40b 100644 --- a/pep_sphinx_extensions/pep_processor/transforms/pep_headers.py +++ b/pep_sphinx_extensions/pep_processor/transforms/pep_headers.py @@ -171,12 +171,7 @@ def _process_discourse_url(parts: list[str]) -> tuple[str, str]: f"{'/'.join(parts)} not a link to a Discourse thread or category") first_subpart = parts[4] - try: - int(first_subpart) - except ValueError: - has_title = True - else: - has_title = False + has_title = not first_subpart.isnumeric() if "t" in parts: item_type = "post" if len(parts) > (5 + has_title) else "thread"