remove redundant import check

This commit is contained in:
woutdenolf 2019-07-08 08:43:18 +02:00
parent 9dc9b8754d
commit 4e3046b01a

View File

@ -153,15 +153,10 @@ def generate_autosummary_content(name: str, obj: Any, parent: Any,
if x in include_public or not x.startswith('_')]
return public, items
def get_modules(obj: Any, include_public: List[str] = [])\
-> Tuple[List[str], List[str]]:
def get_modules(obj: Any, include_public: List[str] = []) -> Tuple[List[str], List[str]]:
items = [] # type: List[str]
for _, modname, ispkg in pkgutil.iter_modules(obj.__path__):
fullname = name + '.' + modname
try:
import_by_name(fullname)
except ImportError:
continue
items.append(fullname)
public = [x for x in items
if x in include_public or