From dcc78f1050be9d181500a3f727c2f4b7d087d451 Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Thu, 3 Mar 2022 19:31:01 +0000 Subject: Don't break if functions are directly in module init files --- docs/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'docs/utils.py') 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__"): -- cgit v1.2.3