summaryrefslogtreecommitdiffstats
path: root/docs/source/conf.py
diff options
context:
space:
mode:
Diffstat (limited to 'docs/source/conf.py')
-rw-r--r--docs/source/conf.py34
1 files changed, 1 insertions, 33 deletions
diff --git a/docs/source/conf.py b/docs/source/conf.py
index 9c5853c73..0e4a41914 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -219,45 +219,13 @@ latex_documents = [
# Autodoc section
# ---------------
-class Mock:
-
- __all__ = []
-
- def __init__(self, *args, **kwargs):
- pass
-
- def __call__(self, *args, **kwargs):
- return ''
-
- @classmethod
- def __getattr__(cls, name):
- if name in ('__file__', '__path__', 'xdg_config_home'):
- return '/dev/null'
- elif name[0] == name[0].upper():
- mock_type = type(name, (), {})
- mock_type.__module__ = __name__
- return mock_type
- else:
- return Mock()
-
- def __add__(self, other):
- return other
-
- def __or__(self, __):
- return Mock()
-
-
-# Use custom mock as autodoc_mock_imports fails to handle these modules.
-MOCK_MODULES = ['deluge._libtorrent', 'xdg', 'xdg.BaseDirectory']
-
-for mod_name in MOCK_MODULES:
- sys.modules[mod_name] = Mock()
# Must add these for autodoc to import packages successfully
builtins.__dict__['_'] = lambda x: x
builtins.__dict__['_n'] = lambda s, p, n: s if n == 1 else p
autodoc_mock_imports = [
+ 'deluge._libtorrent',
'twisted',
'rencode',
'OpenSSL',