mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2025-01-31 03:36:41 +03:00
Fix bug when copying Configuration provider
This commit is contained in:
parent
bb390f51f0
commit
4a24549923
|
@ -19,6 +19,7 @@ Development version
|
||||||
``DynamicContainer.set_providers(**providers)``.
|
``DynamicContainer.set_providers(**providers)``.
|
||||||
- Add method to dynamic catalog for overriding groups of providers -
|
- Add method to dynamic catalog for overriding groups of providers -
|
||||||
``DynamicContainer.set_providers(**overriding_providers)``.
|
``DynamicContainer.set_providers(**overriding_providers)``.
|
||||||
|
- Fix bug when copying ``Configuration`` provider.
|
||||||
|
|
||||||
|
|
||||||
3.8.2
|
3.8.2
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -745,12 +745,15 @@ cdef class Configuration(Provider):
|
||||||
|
|
||||||
def __deepcopy__(self, memo):
|
def __deepcopy__(self, memo):
|
||||||
"""Create and return full copy of provider."""
|
"""Create and return full copy of provider."""
|
||||||
|
cdef Configuration copied
|
||||||
|
|
||||||
copied = memo.get(id(self))
|
copied = memo.get(id(self))
|
||||||
if copied is not None:
|
if copied is not None:
|
||||||
return copied
|
return copied
|
||||||
|
|
||||||
copied = self.__class__(self.__name)
|
copied = self.__class__(self.__name)
|
||||||
copied.update(deepcopy(self.__value))
|
copied.__value = deepcopy(self.__value, memo)
|
||||||
|
copied.__children = deepcopy(self.__children, memo)
|
||||||
|
|
||||||
for overriding_provider in self.overridden:
|
for overriding_provider in self.overridden:
|
||||||
copied.override(deepcopy(overriding_provider, memo))
|
copied.override(deepcopy(overriding_provider, memo))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user