Skip to content

Commit

Permalink
bpo-42869: Avoid an HTTP redirection. (GH-24174)
Browse files Browse the repository at this point in the history
  • Loading branch information
JulienPalard committed Jan 25, 2021
1 parent 5c1f15b commit eb9983c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Lib/pydoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ def getdocloc(self, object, basedir=sysconfig.get_path('stdlib')):
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:
Expand Down

0 comments on commit eb9983c

Please sign in to comment.