From dcecd9f36249337c3757dfa7f5073f65f6516c9d Mon Sep 17 00:00:00 2001 From: Jon Michael Aanes Date: Fri, 9 Aug 2024 16:20:13 +0200 Subject: [PATCH] Fixed backend module importing --- fin_depo/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fin_depo/__init__.py b/fin_depo/__init__.py index 98594f7..d4da570 100644 --- a/fin_depo/__init__.py +++ b/fin_depo/__init__.py @@ -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