mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2024-11-29 13:04:02 +03:00
Fix a bug in the `Configuration
` provider to correctly handle undefined values
This commit is contained in:
parent
b873137614
commit
d9ff0a01fd
File diff suppressed because it is too large
Load Diff
|
@ -1462,6 +1462,9 @@ cdef class Configuration(Object):
|
||||||
keys = selector.split('.')
|
keys = selector.split('.')
|
||||||
value = self.__call__()
|
value = self.__call__()
|
||||||
|
|
||||||
|
if value is None:
|
||||||
|
return None
|
||||||
|
|
||||||
while len(keys) > 0:
|
while len(keys) > 0:
|
||||||
key = keys.pop(0)
|
key = keys.pop(0)
|
||||||
value = value.get(key)
|
value = value.get(key)
|
||||||
|
@ -1507,8 +1510,6 @@ cdef class Configuration(Object):
|
||||||
:return: Overriding context.
|
:return: Overriding context.
|
||||||
:rtype: :py:class:`OverridingContext`
|
:rtype: :py:class:`OverridingContext`
|
||||||
"""
|
"""
|
||||||
if provider is None:
|
|
||||||
provider = {}
|
|
||||||
context = super().override(provider)
|
context = super().override(provider)
|
||||||
self.reset_cache()
|
self.reset_cache()
|
||||||
return context
|
return context
|
||||||
|
|
Loading…
Reference in New Issue
Block a user