Issue #21740: Support wrapped callables in pydoc. Patch by Claudiu Popa.

This commit is contained in:
Yury Selivanov 2014-12-08 15:00:05 -05:00
parent a49d6a213e
commit b532df62b9
3 changed files with 22 additions and 2 deletions

View file

@ -985,7 +985,8 @@ class DocTestFinder:
for valname, val in obj.__dict__.items():
valname = '%s.%s' % (name, valname)
# Recurse to functions & classes.
if ((inspect.isroutine(val) or inspect.isclass(val)) and
if ((inspect.isroutine(inspect.unwrap(val))
or inspect.isclass(val)) and
self._from_module(module, val)):
self._find(tests, val, valname, module, source_lines,
globs, seen)