mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
remove redundant import check
This commit is contained in:
parent
9dc9b8754d
commit
4e3046b01a
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user