Fix bug when copying Configuration provider

This commit is contained in:
Roman Mogylatov 2017-12-25 16:43:45 +02:00
parent bb390f51f0
commit 4a24549923
3 changed files with 1444 additions and 1457 deletions

View File

@ -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

View File

@ -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))