From d01ffc50c81ceaed5c2849a0c0c5eb16281394bc Mon Sep 17 00:00:00 2001 From: Maria Date: Thu, 7 May 2020 17:39:53 -0400 Subject: [PATCH] Fix to register instantiated classes as Singletons. Resolves #1 --- factoryfactory/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/factoryfactory/__init__.py b/factoryfactory/__init__.py index dc46852..e980855 100644 --- a/factoryfactory/__init__.py +++ b/factoryfactory/__init__.py @@ -86,7 +86,7 @@ def get_singleton(*args, **kwargs): # Providers are always registered in self.providers as callable methods if not callable(provider): - self._set_provider(service, lambda *args, **kwargs: provider) + self._set_provider(service, get_singleton) elif singleton: self._set_provider(service, get_singleton) else: