Skip to content

Commit 4eed3d3

Browse files
Fix when module_docs is not available, remove exclusions list.
1 parent 6603b19 commit 4eed3d3

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Lib/pydoc.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -577,15 +577,14 @@ def getdocloc(self, object, basedir=sysconfig.get_path('stdlib')):
577577
'marshal', 'posix', 'signal', 'sys',
578578
'_thread', 'zipimport') or
579579
(file.startswith(basedir) and
580-
not file.startswith(os.path.join(basedir, 'site-packages')))) and
581-
object.__name__ not in ('xml.etree', 'test.test_pydoc.pydoc_mod')):
580+
not file.startswith(os.path.join(basedir, 'site-packages'))))):
582581

583582
try:
584583
from pydoc_data import module_docs
585584
except ImportError:
586585
module_docs = None
587586

588-
if object.__name__ in module_docs.module_docs:
587+
if module_docs and object.__name__ in module_docs.module_docs:
589588
doc_name = module_docs.module_docs[object.__name__]
590589
if docloc.startswith(("http://", "https://")):
591590
docloc = "{}/{}".format(docloc.rstrip("/"), doc_name)

0 commit comments

Comments
 (0)