Fixed backend module importing
All checks were successful
Test Python / Test (push) Successful in 26s
All checks were successful
Test Python / Test (push) Successful in 26s
This commit is contained in:
parent
8c6ff75a71
commit
dcecd9f362
|
@ -74,13 +74,14 @@ CURRENT_MODULE = sys.modules[__name__]
|
|||
def load_backend(name: str) -> object | None:
|
||||
try:
|
||||
imported_module = importlib.import_module(f'{__name__}.{name}')
|
||||
CURRENT_MODULE.setmember(name, imported_module)
|
||||
except Exception:
|
||||
logger.exception(
|
||||
'Backend "%s" could not be imported. Are all module dependencies installed?',
|
||||
name,
|
||||
)
|
||||
return None
|
||||
setattr(CURRENT_MODULE, name, imported_module)
|
||||
return imported_module
|
||||
|
||||
|
||||
# Import modules
|
||||
|
|
Loading…
Reference in New Issue
Block a user