diff --git a/src/cpl_core/cpl-core.json b/src/cpl_core/cpl-core.json index 1af2960f..2072dda3 100644 --- a/src/cpl_core/cpl-core.json +++ b/src/cpl_core/cpl-core.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "12", - "Micro": "1" + "Micro": "1.post1" }, "Author": "Sven Heidemann", "AuthorEmail": "sven.heidemann@sh-edraft.de", diff --git a/src/cpl_core/dependency_injection/service_provider_abc.py b/src/cpl_core/dependency_injection/service_provider_abc.py index a3f7158c..f2890d3c 100644 --- a/src/cpl_core/dependency_injection/service_provider_abc.py +++ b/src/cpl_core/dependency_injection/service_provider_abc.py @@ -13,14 +13,16 @@ class ServiceProviderABC(ABC): _provider: Optional['ServiceProviderABC'] = None @abstractmethod - def __init__(self): pass + def __init__(self): + pass @classmethod def set_global_provider(cls, provider: 'ServiceProviderABC'): cls._provider = provider @abstractmethod - def build_by_signature(self, sig: Signature) -> list[T]: pass + def build_by_signature(self, sig: Signature) -> list[T]: + pass @abstractmethod def build_service(self, service_type: type) -> object: @@ -108,7 +110,7 @@ class ServiceProviderABC(ABC): if cls._provider is None: raise Exception(f'{cls.__name__} not build!') - injection = cls._provider.build_by_signature(signature(f)) + injection = [x for x in cls._provider.build_by_signature(signature(f)) if x is not None] return f(*injection, *args, **kwargs) return inner