diff --git a/CHANGES b/CHANGES index a5dc6da15..4c33180a3 100644 --- a/CHANGES +++ b/CHANGES @@ -63,6 +63,7 @@ Bugs fixed * #7023: autodoc: nested partial functions are not listed * #7023: autodoc: partial functions imported from other modules are listed as module members without :impoprted-members: option +* #6889: autodoc: Trailing comma in ``:members::`` option causes cryptic warning Testing -------- diff --git a/sphinx/ext/autodoc/__init__.py b/sphinx/ext/autodoc/__init__.py index c9eb5207f..e42169684 100644 --- a/sphinx/ext/autodoc/__init__.py +++ b/sphinx/ext/autodoc/__init__.py @@ -72,14 +72,14 @@ 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(',')] + return [x.strip() for x in arg.split(',') if x.strip()] def members_set_option(arg: Any) -> Union[object, Set[str]]: """Used to convert the :members: option to auto directives.""" if arg is None: return ALL - return {x.strip() for x in arg.split(',')} + return {x.strip() for x in arg.split(',') if x.strip()} SUPPRESS = object()