File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -991,7 +991,13 @@ def _link_inheritance(self):
991991 return
992992
993993 for name , parent_dobj in self ._super_members .items ():
994- dobj = self .doc [name ]
994+ try :
995+ dobj = self .doc [name ]
996+ except KeyError :
997+ # There is a key in __pdoc__ blocking this member
998+ assert any (i .endswith (self .qualname + '.' + name )
999+ for i in self .module .obj .__pdoc__ )
1000+ continue
9951001 if (dobj .obj is parent_dobj .obj or
9961002 (dobj .docstring or parent_dobj .docstring ) == parent_dobj .docstring ):
9971003 dobj .inherits = parent_dobj
Original file line number Diff line number Diff line change @@ -495,6 +495,12 @@ def test__pdoc__dict(self):
495495 self .assertNotIn ('f' , mod .doc ['B' ].doc )
496496 self .assertIsInstance (mod .find_ident ('B.f' ), pdoc .External )
497497
498+ # GH-125: https://github.com/pdoc3/pdoc/issues/125
499+ with patch .object (module , '__pdoc__' , {'B.inherited' : False }):
500+ mod = pdoc .Module (module )
501+ pdoc .link_inheritance ()
502+ self .assertNotIn ('inherited' , mod .doc ['B' ].doc )
503+
498504 def test__pdoc__invalid_value (self ):
499505 module = pdoc .import_module (EXAMPLE_MODULE )
500506 with patch .object (module , '__pdoc__' , {'B' : 1 }), \
You can’t perform that action at this time.
0 commit comments