1515import importlib
1616import importlib .util
1717import itertools
18+ from types import ModuleType
1819from typing import Any , Iterable , Tuple , Type
1920
2021import jsonschema
@@ -44,8 +45,8 @@ def load_module(provider: dict, config_path: Iterable[str]) -> Tuple[Type, Any]:
4445
4546 # We need to import the module, and then pick the class out of
4647 # that, so we split based on the last dot.
47- module , clz = modulename .rsplit ("." , 1 )
48- module = importlib .import_module (module )
48+ module_name , clz = modulename .rsplit ("." , 1 )
49+ module = importlib .import_module (module_name )
4950 provider_class = getattr (module , clz )
5051
5152 # Load the module config. If None, pass an empty dictionary instead
@@ -69,11 +70,11 @@ def load_module(provider: dict, config_path: Iterable[str]) -> Tuple[Type, Any]:
6970 return provider_class , provider_config
7071
7172
72- def load_python_module (location : str ):
73+ def load_python_module (location : str ) -> ModuleType :
7374 """Load a python module, and return a reference to its global namespace
7475
7576 Args:
76- location (str) : path to the module
77+ location: path to the module
7778
7879 Returns:
7980 python module object
0 commit comments