bpo-42869: Avoid an HTTP redirection. (GH-24174)

This commit is contained in:
Julien Palard 2021-01-25 15:50:14 +01:00 committed by GitHub
parent 5c1f15b4b1
commit eb9983c59b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -504,7 +504,7 @@ class Doc:
not file.startswith(os.path.join(basedir, 'site-packages')))) and
object.__name__ not in ('xml.etree', 'test.pydoc_mod')):
if docloc.startswith(("http://", "https://")):
docloc = "%s/%s" % (docloc.rstrip("/"), object.__name__.lower())
docloc = "{}/{}.html".format(docloc.rstrip("/"), object.__name__.lower())
else:
docloc = os.path.join(docloc, object.__name__.lower() + ".html")
else: