Skip to content

Commit

Permalink
catch the error
Browse files Browse the repository at this point in the history
  • Loading branch information
liyin2015 committed Jul 6, 2024
1 parent 1af617b commit 2914aff
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions docs/source/insert_autosummary.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,16 @@ def generate_autosummary_docs(src_dir, dest_dir):
print(f"module_full_name: {module_full_name}")
module_dir = dest_dir
# spec and load the module
spec = importlib.util.spec_from_file_location(module_full_name, code_path)
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
generate_rst_for_module(module_full_name, module, module_dir)
try:
spec = importlib.util.spec_from_file_location(
module_full_name, code_path
)
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
generate_rst_for_module(module_full_name, module, module_dir)
except Exception as e:
print(f"Error loading module {module_full_name}: {e}")
continue


if __name__ == "__main__":
Expand Down

0 comments on commit 2914aff

Please sign in to comment.