Fix #6889: autodoc: Trailing comma in :members:: option causes cryptic warning

This commit is contained in:
Takeshi KOMIYA 2020-01-31 00:42:26 +09:00
parent 569a5d53b0
commit e4bc1a48ac
2 changed files with 3 additions and 2 deletions

View File

@ -63,6 +63,7 @@ Bugs fixed
* #7023: autodoc: nested partial functions are not listed * #7023: autodoc: nested partial functions are not listed
* #7023: autodoc: partial functions imported from other modules are listed as * #7023: autodoc: partial functions imported from other modules are listed as
module members without :impoprted-members: option module members without :impoprted-members: option
* #6889: autodoc: Trailing comma in ``:members::`` option causes cryptic warning
Testing Testing
-------- --------

View File

@ -72,14 +72,14 @@ def members_option(arg: Any) -> Union[object, List[str]]:
"""Used to convert the :members: option to auto directives.""" """Used to convert the :members: option to auto directives."""
if arg is None or arg is True: if arg is None or arg is True:
return ALL return ALL
return [x.strip() for x in arg.split(',')] return [x.strip() for x in arg.split(',') if x.strip()]
def members_set_option(arg: Any) -> Union[object, Set[str]]: def members_set_option(arg: Any) -> Union[object, Set[str]]:
"""Used to convert the :members: option to auto directives.""" """Used to convert the :members: option to auto directives."""
if arg is None: if arg is None:
return ALL return ALL
return {x.strip() for x in arg.split(',')} return {x.strip() for x in arg.split(',') if x.strip()}
SUPPRESS = object() SUPPRESS = object()