diff options
author | pbudzyns <pawel.budzynski@cern.ch> | 2021-02-01 11:46:19 +0300 |
---|---|---|
committer | pbudzyns <pawel.budzynski@cern.ch> | 2021-02-01 11:46:19 +0300 |
commit | 8d380cadc723149f2391685c73b00b48e8a3bc0b (patch) | |
tree | 8e4f0bf7905349b57c05767499762dc4f22dfe1f /sphinx/ext | |
parent | dc277e0e18b4bed5191eb3ce875a96ae6c123768 (diff) |
check if autodoc_defaults are str, fix tests
Diffstat (limited to 'sphinx/ext')
-rw-r--r-- | sphinx/ext/autodoc/directive.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sphinx/ext/autodoc/directive.py b/sphinx/ext/autodoc/directive.py index 47c6766e5..c88600ff2 100644 --- a/sphinx/ext/autodoc/directive.py +++ b/sphinx/ext/autodoc/directive.py @@ -87,7 +87,7 @@ def process_documenter_options(documenter: "Type[Documenter]", config: Config, o else: negated = options.pop('no-' + name, True) is None if name in config.autodoc_default_options and not negated: - if name in options: + if name in options and isinstance(config.autodoc_default_options[name], str): # take value from options if present or extend it # with autodoc_default_options if necessary if name in AUTODOC_EXTENDABLE_OPTIONS: @@ -97,9 +97,9 @@ def process_documenter_options(documenter: "Type[Documenter]", config: Config, o else: options[name] = config.autodoc_default_options[name] - elif isinstance(options.get(name), str) and options[name].startswith('+'): + elif options.get(name) is not None: # remove '+' from option argument if there's nothing to merge it with - options[name] = options[name].strip('+') + options[name] = options[name].lstrip('+') return Options(assemble_option_dict(options.items(), documenter.option_spec)) |