mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #8570 from tk0miya/8569_getslots_TypeError
Fixes #8568. Ignore TypeError from getslots in isslotsattribute
This commit is contained in:
1
CHANGES
1
CHANGES
@@ -18,6 +18,7 @@ Bugs fixed
|
||||
|
||||
* #8559: autodoc: AttributeError is raised when using forward-reference type
|
||||
annotations
|
||||
* #8568: autodoc: TypeError is raised on checking slots attribute
|
||||
|
||||
Testing
|
||||
--------
|
||||
|
||||
@@ -2114,7 +2114,7 @@ class SlotsMixin(DataDocumenterMixinBase):
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
except (AttributeError, ValueError):
|
||||
except (AttributeError, ValueError, TypeError):
|
||||
return False
|
||||
|
||||
def import_object(self, raiseerror: bool = False) -> bool:
|
||||
|
||||
@@ -187,6 +187,7 @@ def getslots(obj: Any) -> Optional[Dict]:
|
||||
|
||||
Return None if gienv *obj* does not have __slots__.
|
||||
Raises AttributeError if given *obj* raises an error on accessing __slots__.
|
||||
Raises TypeError if given *obj* is not a class.
|
||||
Raises ValueError if given *obj* have invalid __slots__.
|
||||
"""
|
||||
if not inspect.isclass(obj):
|
||||
|
||||
Reference in New Issue
Block a user