diff --git a/CHANGES b/CHANGES index aac8a8b35..d21c82a5e 100644 --- a/CHANGES +++ b/CHANGES @@ -18,6 +18,7 @@ Bugs fixed * #6442: LaTeX: admonitions of :rst:dir:`note` type can get separated from immediately preceding section title by pagebreak +* #6448: autodoc: crashed when autodocumenting classes with ``__slots__ = None`` Testing -------- diff --git a/sphinx/ext/autodoc/importer.py b/sphinx/ext/autodoc/importer.py index 37bdae8a9..0c6f47039 100644 --- a/sphinx/ext/autodoc/importer.py +++ b/sphinx/ext/autodoc/importer.py @@ -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__: