mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 00:04:15 +02:00
Modernize runtime compatibility and initialize Bearhub fork
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import inspect
|
||||
import importlib
|
||||
import os
|
||||
import pkgutil
|
||||
from logging import Logger
|
||||
from typing import List, Generator
|
||||
|
||||
@@ -49,11 +49,14 @@ def load_managers(locale: str, context: ApplicationContext, config: dict, defaul
|
||||
logger.warning(f"gem '{f.name}' could not be loaded because it was marked as forbidden in '{FORBIDDEN_GEMS_FILE}'")
|
||||
continue
|
||||
|
||||
loader = pkgutil.find_loader(f'bauh.gems.{f.name}.controller')
|
||||
module_name = f'bauh.gems.{f.name}.controller'
|
||||
|
||||
if loader:
|
||||
module = loader.load_module()
|
||||
try:
|
||||
module = importlib.import_module(module_name)
|
||||
except ModuleNotFoundError:
|
||||
module = None
|
||||
|
||||
if module:
|
||||
manager_class = find_manager(module)
|
||||
|
||||
if manager_class:
|
||||
|
||||
Reference in New Issue
Block a user