diff --git a/rose/client/main.py b/rose/client/main.py index 15f20c7e..d57bc382 100644 --- a/rose/client/main.py +++ b/rose/client/main.py @@ -9,20 +9,17 @@ def load_driver_module(driver_path): """ Load the driver module from the specified path. - :param driver_path: Path to the driver module. - :return: The loaded module. - :raises ImportError: If there's an issue loading the module. + Arguments: + file_path (str): The path to the driver module + Returns: + Driver module (module) + Raises: + Exception if the module cannot be loaded """ - try: - spec = importlib.util.spec_from_file_location("driver_module", driver_path) - driver_module = importlib.util.module_from_spec(spec) - spec.loader.exec_module(driver_module) - return driver_module - except Exception as e: - raise ImportError( - f"Error loading driver module from path {driver_path}: {str(e)}" - ) - + spec = importlib.util.spec_from_file_location("driver_module", driver_path) + driver_module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(driver_module) + return driver_module def main(): """