summaryrefslogtreecommitdiff
path: root/sphinx/ext/autodoc.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2016-11-02 23:01:16 +0900
committerGitHub <noreply@github.com>2016-11-02 23:01:16 +0900
commitb32d9a9bc7d19eb6ba2dfaaf3c08b1e587c441cb (patch)
tree1e1cc88736ed626a44ffb566612daa9fab7a38ef /sphinx/ext/autodoc.py
parent1777939fa49b8d43b72e2c962df991b265aec664 (diff)
parent7943da940832147f60c6d59c58d693464e77f513 (diff)
downloadsphinx-git-b32d9a9bc7d19eb6ba2dfaaf3c08b1e587c441cb.tar.gz
Merge pull request #3071 from mleinart/autodoc/pass_through_decorators
Autodoc: Allow mocked module decorators to pass-through functions unchanged
Diffstat (limited to 'sphinx/ext/autodoc.py')
-rw-r--r--sphinx/ext/autodoc.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py
index 98783cfdb..148c09811 100644
--- a/sphinx/ext/autodoc.py
+++ b/sphinx/ext/autodoc.py
@@ -93,6 +93,9 @@ class _MockModule(object):
self.__all__ = []
def __call__(self, *args, **kwargs):
+ if args and type(args[0]) in [FunctionType, MethodType]:
+ # Appears to be a decorator, pass through unchanged
+ return args[0]
return _MockModule()
def _append_submodule(self, submod):