mirror of
https://github.com/wassname/scikit-image.git
synced 2026-06-27 19:48:43 +08:00
apigen: Fix function detection in Python 3
This commit is contained in:
+3
-3
@@ -21,7 +21,7 @@ is an MIT-licensed project.
|
||||
import os
|
||||
import re
|
||||
|
||||
from types import BuiltinFunctionType
|
||||
from types import BuiltinFunctionType, FunctionType
|
||||
|
||||
# suppress print statements (warnings for empty files)
|
||||
DEBUG = True
|
||||
@@ -210,9 +210,9 @@ class ApiDocWriter(object):
|
||||
if obj_str not in mod.__dict__:
|
||||
continue
|
||||
obj = mod.__dict__[obj_str]
|
||||
|
||||
# figure out if obj is a function or class
|
||||
if hasattr(obj, 'func_name') or \
|
||||
isinstance(obj, BuiltinFunctionType):
|
||||
if isinstance(obj, FunctionType):
|
||||
functions.append(obj_str)
|
||||
else:
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user