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:
|
def load_backend(name: str) -> object | None:
|
||||||
try:
|
try:
|
||||||
imported_module = importlib.import_module(f'{__name__}.{name}')
|
imported_module = importlib.import_module(f'{__name__}.{name}')
|
||||||
CURRENT_MODULE.setmember(name, imported_module)
|
|
||||||
except Exception:
|
except Exception:
|
||||||
logger.exception(
|
logger.exception(
|
||||||
'Backend "%s" could not be imported. Are all module dependencies installed?',
|
'Backend "%s" could not be imported. Are all module dependencies installed?',
|
||||||
name,
|
name,
|
||||||
)
|
)
|
||||||
return None
|
return None
|
||||||
|
setattr(CURRENT_MODULE, name, imported_module)
|
||||||
|
return imported_module
|
||||||
|
|
||||||
|
|
||||||
# Import modules
|
# Import modules
|
||||||
|
|
Loading…
Reference in New Issue
Block a user