Skip to content

Commit 252fc89

Browse files
committed
BUG: Fix finding of functions in doc generation
We were not finding functions correctly from imported modules. Port in code from same function in scikit-image.
1 parent 5a15872 commit 252fc89

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

doc/tools/apigen.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import re
2323
from inspect import getmodule
2424

25-
from types import BuiltinFunctionType
25+
from types import BuiltinFunctionType, FunctionType
2626

2727
# suppress print statements (warnings for empty files)
2828
DEBUG = True
@@ -221,8 +221,7 @@ def _parse_module_with_import(self, uri):
221221
if not self.other_defines and not getmodule(obj) == mod:
222222
continue
223223
# figure out if obj is a function or class
224-
if hasattr(obj, 'func_name') or \
225-
isinstance(obj, BuiltinFunctionType):
224+
if isinstance(obj, (FunctionType, BuiltinFunctionType)):
226225
functions.append(obj_str)
227226
else:
228227
try:

0 commit comments

Comments
 (0)