diff options
author | 2022-03-03 19:31:01 +0000 | |
---|---|---|
committer | 2022-03-03 22:01:24 +0000 | |
commit | dcc78f1050be9d181500a3f727c2f4b7d087d451 (patch) | |
tree | 9669015138dc8d77c81412c3d0d07be314272305 /docs | |
parent | Surface apply_monkey_patches directly in the util namespace (diff) |
Don't break if functions are directly in module init files
Diffstat (limited to 'docs')
-rw-r--r-- | docs/utils.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/docs/utils.py b/docs/utils.py index 76b3e098..9116c130 100644 --- a/docs/utils.py +++ b/docs/utils.py @@ -105,7 +105,10 @@ def __get_included() -> set[str]: """Get a list of files that should be included in the final build.""" def get_all_from_module(module_name: str) -> set[str]: - module = importlib.import_module(module_name) + try: + module = importlib.import_module(module_name) + except ModuleNotFoundError: + return {} _modules = {module.__name__ + ".rst"} if hasattr(module, "__all__"): |