1
0

Fixed backend module importing
All checks were successful
Test Python / Test (push) Successful in 26s

This commit is contained in:
Jon Michael Aanes 2024-08-09 16:20:13 +02:00
parent 8c6ff75a71
commit dcecd9f362
Signed by: Jmaa
SSH Key Fingerprint: SHA256:Ab0GfHGCblESJx7JRE4fj4bFy/KRpeLhi41y4pF3sNA

View File

@ -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