Skip to content

Commit

Permalink
fix pydoc in loading driver
Browse files Browse the repository at this point in the history
Signed-off-by: yzamir <kobi.zamir@gmail.com>
  • Loading branch information
yaacov committed Sep 12, 2023
1 parent 23670ca commit f936cc7
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions rose/client/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
"""
Expand Down

0 comments on commit f936cc7

Please sign in to comment.