diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-08-22 00:44:07 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-08-22 00:50:29 +0900 |
commit | e0b2162a77a8a6021f9e17129d6fa23eeceac48c (patch) | |
tree | 7612787287bc21084ad9fefaf1e543c03f033464 /sphinx/ext | |
parent | f861b4cd1a5d5f1a100dca709ea72a7e4c007bd7 (diff) | |
download | sphinx-git-e0b2162a77a8a6021f9e17129d6fa23eeceac48c.tar.gz |
Fix #8143: AttributeError if autodoc_default_options contains False
autodoc crahses when autodoc_default_options contains False value
unexpectedly. After this change, it also accepts False.
Diffstat (limited to 'sphinx/ext')
-rw-r--r-- | sphinx/ext/autodoc/__init__.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sphinx/ext/autodoc/__init__.py b/sphinx/ext/autodoc/__init__.py index b61a96c84..ed02c2c90 100644 --- a/sphinx/ext/autodoc/__init__.py +++ b/sphinx/ext/autodoc/__init__.py @@ -94,7 +94,10 @@ def members_option(arg: Any) -> Union[object, List[str]]: """Used to convert the :members: option to auto directives.""" if arg is None or arg is True: return ALL - return [x.strip() for x in arg.split(',') if x.strip()] + elif arg is False: + return None + else: + return [x.strip() for x in arg.split(',') if x.strip()] def members_set_option(arg: Any) -> Union[object, Set[str]]: @@ -172,7 +175,7 @@ def merge_members_option(options: Dict) -> None: members = options.setdefault('members', []) for key in {'private-members', 'special-members'}: - if key in options and options[key] is not ALL: + if key in options and options[key] not in (ALL, None): for member in options[key]: if member not in members: members.append(member) |