summaryrefslogtreecommitdiffstats
path: root/bindings
diff options
context:
space:
mode:
authorJani Nikula <jani.nikula@intel.com>2019-02-11 20:22:35 +0200
committerDavid Bremner <david@tethera.net>2019-02-16 08:42:13 -0400
commit510dc8c8377e4fef1e96c13c2ea3f25f4b51c889 (patch)
tree2cce8fa3a7b711a2d5c97799e0ed45daa273a6f3 /bindings
parent3c752b855f900f5251df9997514b4d27d9f38e83 (diff)
python: fix documentation build with python 3.7
The simplistic mocking in conf.py falls short on python 3.7. Just use unittest.mock instead. Fixes: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/sphinx/config.py", line 368, in eval_config_file execfile_(filename, namespace) File "/usr/lib/python3/dist-packages/sphinx/util/pycompat.py", line 150, in execfile_ exec_(code, _globals) File "/path/to/notmuch/bindings/python/docs/source/conf.py", line 39, in <module> from notmuch import __VERSION__,__AUTHOR__ File "/path/to/notmuch/bindings/python/notmuch/__init__.py", line 54, in <module> from .database import Database File "/path/to/notmuch/bindings/python/notmuch/database.py", line 25, in <module> from .globals import ( File "/path/to/notmuch/bindings/python/notmuch/globals.py", line 48, in <module> class NotmuchDatabaseS(Structure): TypeError: __mro_entries__ must return a tuple
Diffstat (limited to 'bindings')
-rw-r--r--bindings/python/docs/source/conf.py13
1 files changed, 2 insertions, 11 deletions
diff --git a/bindings/python/docs/source/conf.py b/bindings/python/docs/source/conf.py
index 5b901c4e..8b43c5ca 100644
--- a/bindings/python/docs/source/conf.py
+++ b/bindings/python/docs/source/conf.py
@@ -13,22 +13,13 @@
import sys, os
+from unittest.mock import Mock
+
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0,os.path.abspath('../..'))
-class Mock(object):
- def __init__(self, *args, **kwargs):
- pass
-
- def __call__(self, *args, **kwargs):
- return Mock()
-
- @classmethod
- def __getattr__(self, name):
- return Mock() if name not in ('__file__', '__path__') else '/dev/null'
-
MOCK_MODULES = [
'ctypes',
]