]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-125895: Fix static asset location for `sphinx-notfound-page` (GH-147984...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 3 Apr 2026 15:40:32 +0000 (17:40 +0200)
committerGitHub <noreply@github.com>
Fri, 3 Apr 2026 15:40:32 +0000 (16:40 +0100)
(cherry picked from commit 80ab6d958a0e4aa322aaf96994c43cd637496be6)

Co-authored-by: Stan Ulbrych <stan@python.org>
Doc/conf.py

index b218e3e7c0464e4730f68820ef8433ab134060fa..34715918a5fe5b307bbc6c6f5a23a1ccaf716a6a 100644 (file)
@@ -561,6 +561,17 @@ extlinks_detect_hardcoded_links = True
 refcount_file = 'data/refcounts.dat'
 stable_abi_file = 'data/stable_abi.dat'
 
+# Options for notfound.extension
+# -------------------------------
+
+if not os.getenv("READTHEDOCS"):
+    if language_code:
+        notfound_urls_prefix = (
+            f'/{language_code.replace("_", "-").lower()}/{version}/'
+        )
+    else:
+        notfound_urls_prefix = f'/{version}/'
+
 # Options for sphinxext-opengraph
 # -------------------------------