mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
doc: Do not mock non-existing __mro_entries__ attribute
Building the documentation with the Python 3.7 version of sphinx fails: ``` $ make -C doc html SPHINXBUILD="python3.7 /usr/bin/sphinx-build" [...] WARNING: autodoc: failed to import module 'salt.states.pkg'; the following exception was raised: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/sphinx/ext/autodoc/importer.py", line 152, in import_module __import__(modname) File "salt/states/pkg.py", line 84, in <module> import salt.utils.pkg File "salt/utils/pkg/__init__.py", line 13, in <module> import salt.utils.data File "salt/utils/data.py", line 23, in <module> import salt.utils.yaml File "salt/utils/yaml.py", line 9, in <module> from salt.utils.yamldumper import * File "salt/utils/yamldumper.py", line 34, in <module> class IndentMixin(Dumper): TypeError: __mro_entries__ must return a tuple ``` Instead of returning a Mock object for the `__mro_entries__` attribute, raise an AttributeError instead. Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
This commit is contained in:
parent
e6cf3c4a94
commit
bb2994898c
1 changed files with 2 additions and 2 deletions
|
@ -46,8 +46,8 @@ class Mock(object):
|
|||
data = self.__mapping.get(name)
|
||||
elif name in ('__file__', '__path__'):
|
||||
data = '/dev/null'
|
||||
elif name == '__qualname__':
|
||||
raise AttributeError("'Mock' object has no attribute '__qualname__'")
|
||||
elif name in ('__mro_entries__', '__qualname__'):
|
||||
raise AttributeError("'Mock' object has no attribute '%s'" % (name))
|
||||
else:
|
||||
data = Mock(mapping=self.__mapping)
|
||||
return data
|
||||
|
|
Loading…
Add table
Reference in a new issue