diff options
author | jfbu <jfbu@free.fr> | 2016-12-17 16:50:35 +0100 |
---|---|---|
committer | jfbu <jfbu@free.fr> | 2016-12-17 16:50:35 +0100 |
commit | 3099150a0d5cac0d01fe04c3fcf8801527d93490 (patch) | |
tree | 67e83216fbb6d19d76628aa456abd537e6a92234 /sphinx/ext/autodoc.py | |
parent | ffa6f5a8e97801e60a4e8a2adad05ffabb8ccdaf (diff) | |
parent | 3a4175c1cc564be07753ffba12d0a6d746d5c282 (diff) | |
download | sphinx-git-3099150a0d5cac0d01fe04c3fcf8801527d93490.tar.gz |
Merge branch 'stable'
Diffstat (limited to 'sphinx/ext/autodoc.py')
-rw-r--r-- | sphinx/ext/autodoc.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py index 8ed9f4cba..4251c7169 100644 --- a/sphinx/ext/autodoc.py +++ b/sphinx/ext/autodoc.py @@ -33,7 +33,8 @@ from sphinx.pycode import ModuleAnalyzer, PycodeError from sphinx.application import ExtensionError from sphinx.util.nodes import nested_parse_with_titles from sphinx.util.inspect import getargspec, isdescriptor, safe_getmembers, \ - safe_getattr, object_description, is_builtin_class_method, isenumattribute + safe_getattr, object_description, is_builtin_class_method, \ + isenumclass, isenumattribute from sphinx.util.docstrings import prepare_docstring if False: @@ -829,6 +830,14 @@ class Documenter(object): else: members = [(mname, self.get_attr(self.object, mname, None)) for mname in list(iterkeys(obj_dict))] + + # Py34 doesn't have enum members in __dict__. + if isenumclass(self.object): + members.extend( + item for item in self.object.__members__.items() + if item not in members + ) + membernames = set(m[0] for m in members) # add instance attributes from the analyzer for aname in analyzed_member_names: |