mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #7858 from tk0miya/7856_autoclass_crashed_for_non_classobj
Fix #7856: autodoc: AttributeError is raised for non-class object
This commit is contained in:
commit
da395b4132
2
CHANGES
2
CHANGES
@ -17,6 +17,8 @@ Bugs fixed
|
||||
----------
|
||||
|
||||
* #7844: autodoc: Failed to detect module when relative module name given
|
||||
* #7856: autodoc: AttributeError is raised when non-class object is given to
|
||||
the autoclass directive
|
||||
|
||||
Testing
|
||||
--------
|
||||
|
@ -826,7 +826,12 @@ class Documenter:
|
||||
self.add_line('', sourcename)
|
||||
|
||||
# format the object's signature, if any
|
||||
sig = self.format_signature()
|
||||
try:
|
||||
sig = self.format_signature()
|
||||
except Exception as exc:
|
||||
logger.warning(__('error while formatting signature for %s: %s'),
|
||||
self.fullname, exc, type='autodoc')
|
||||
return
|
||||
|
||||
# generate the directive header and options, if applicable
|
||||
self.add_directive_header(sig)
|
||||
|
Loading…
Reference in New Issue
Block a user