Skip to content

Commit ae0091e

Browse files
author
gdgate
authored
Merge pull request #608 from hkad98/fix-docs
Fix bug in json_builder.py Reviewed-by: https://github.com/Mara3l
2 parents 87ab8c8 + 980d598 commit ae0091e

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

scripts/docs/json_builder.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -297,11 +297,12 @@ def import_submodules(pkg_name: str) -> dict[str, ModuleType]:
297297
pkg_name (str): package name
298298
"""
299299
package = sys.modules[pkg_name]
300-
301-
return {
302-
name: importlib.import_module(f"{pkg_name}.{name}")
303-
for loader, name, is_pkg in pkgutil.walk_packages(package.__path__)
304-
}
300+
dictionary = {}
301+
for loader, name, is_pkg in pkgutil.walk_packages(package.__path__):
302+
try:
303+
dictionary[name] = importlib.import_module(f"{pkg_name}.{name}")
304+
except ImportError:
305+
pass
305306

306307

307308
if __name__ == "__main__":

0 commit comments

Comments
 (0)