mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Protect get_sourcename against misbehaving __getattr__
This commit is contained in:
parent
cf38356a08
commit
69af4d2d00
@ -585,8 +585,8 @@ class Documenter:
|
||||
yield from docstringlines
|
||||
|
||||
def get_sourcename(self) -> str:
|
||||
if (getattr(self.object, '__module__', None) and
|
||||
getattr(self.object, '__qualname__', None)):
|
||||
if (inspect.safe_getattr(self.object, '__module__', None) and
|
||||
inspect.safe_getattr(self.object, '__qualname__', None)):
|
||||
# Get the correct location of docstring from self.object
|
||||
# to support inherited methods
|
||||
fullname = '%s.%s' % (self.object.__module__, self.object.__qualname__)
|
||||
|
Loading…
Reference in New Issue
Block a user