File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,13 +37,14 @@ def __getattr__(name):
3737 ]
3838
3939 if name in known_modules :
40- return importlib .import_module (f"mhkit.{ name } " )
41-
42- if name in known_modules :
43- error_msg = f"\n \n To install the { name } module, run:\n "
44- error_msg += f"pip install mhkit[{ name } ]\n \n "
45- error_msg += "Or install all modules with:\n "
46- error_msg += "pip install mhkit[all]"
40+ try :
41+ return importlib .import_module (f"mhkit.{ name } " )
42+ except ModuleNotFoundError :
43+ error_msg = "Module dependencies not found.\n "
44+ error_msg += f"To install the { name } module, run:\n "
45+ error_msg += f" pip install mhkit[{ name } ]\n \n "
46+ error_msg += "Or install all modules with:\n "
47+ error_msg += " pip install mhkit[all]"
4748 else :
4849 error_msg = f"module 'mhkit' has no attribute '{ name } '"
4950
You can’t perform that action at this time.
0 commit comments