From f8200bdddc4a84cabd656cf0bd9ae185fa703857 Mon Sep 17 00:00:00 2001 From: Michael Leinartas Date: Wed, 19 Oct 2016 16:20:16 -0500 Subject: [PATCH] Autodoc: Allow mocked module decorators to pass-through --- sphinx/ext/autodoc.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py index 6a1d907fd..a936fdddd 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):