Don't crash when autodocumenting classes with __slots__ = None

This commit is contained in:
Audrey Dutcher 2019-06-04 19:44:28 -07:00 committed by Takeshi KOMIYA
parent 3360f2461c
commit e3321bb3a9

View File

@ -128,7 +128,7 @@ def get_object_members(subject, objpath, attrgetter, analyzer=None):
members[name] = Attribute(name, True, value)
# members in __slots__
if isclass(subject) and hasattr(subject, '__slots__'):
if isclass(subject) and getattr(subject, '__slots__', None) is not None:
from sphinx.ext.autodoc import SLOTSATTR
for name in subject.__slots__: