Merge pull request #6448 from rhelmot/master

Don't crash when autodocumenting classes with __slots__ = None
This commit is contained in:
Takeshi KOMIYA 2019-06-05 22:27:21 +09:00 committed by GitHub
commit 5ce5c2c315
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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__: