Skip to content

Commit

Permalink
Merge pull request #608 from hkad98/fix-docs
Browse files Browse the repository at this point in the history
Fix bug in json_builder.py

Reviewed-by: https://github.com/Mara3l
  • Loading branch information
gdgate authored Mar 21, 2024
2 parents 87ab8c8 + 980d598 commit ae0091e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions scripts/docs/json_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,11 +297,12 @@ def import_submodules(pkg_name: str) -> dict[str, ModuleType]:
pkg_name (str): package name
"""
package = sys.modules[pkg_name]

return {
name: importlib.import_module(f"{pkg_name}.{name}")
for loader, name, is_pkg in pkgutil.walk_packages(package.__path__)
}
dictionary = {}
for loader, name, is_pkg in pkgutil.walk_packages(package.__path__):
try:
dictionary[name] = importlib.import_module(f"{pkg_name}.{name}")
except ImportError:
pass


if __name__ == "__main__":
Expand Down

0 comments on commit ae0091e

Please sign in to comment.