Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix when module_docs is not available, remove exclusions list.
  • Loading branch information
StanFromIreland committed Oct 13, 2025
commit 4eed3d34d9d96ffd2ac06c22e027bf9077fb8302
5 changes: 2 additions & 3 deletions Lib/pydoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,15 +577,14 @@ def getdocloc(self, object, basedir=sysconfig.get_path('stdlib')):
'marshal', 'posix', 'signal', 'sys',
'_thread', 'zipimport') or
(file.startswith(basedir) and
not file.startswith(os.path.join(basedir, 'site-packages')))) and
object.__name__ not in ('xml.etree', 'test.test_pydoc.pydoc_mod')):
not file.startswith(os.path.join(basedir, 'site-packages'))))):

try:
from pydoc_data import module_docs
except ImportError:
module_docs = None

if object.__name__ in module_docs.module_docs:
if module_docs and object.__name__ in module_docs.module_docs:
doc_name = module_docs.module_docs[object.__name__]
if docloc.startswith(("http://", "https://")):
docloc = "{}/{}".format(docloc.rstrip("/"), doc_name)
Expand Down
Loading