Show More
@@ -244,17 +244,14 b' class Config(dict):' | |||||
244 | return type(self)(copy.deepcopy(list(self.items()))) |
|
244 | return type(self)(copy.deepcopy(list(self.items()))) | |
245 |
|
245 | |||
246 | def __getitem__(self, key): |
|
246 | def __getitem__(self, key): | |
247 | if _is_section_key(key): |
|
247 | try: | |
248 | try: |
|
248 | return dict.__getitem__(self, key) | |
249 | return dict.__getitem__(self, key) |
|
249 | except KeyError: | |
250 | except KeyError: |
|
250 | if _is_section_key(key): | |
251 | c = Config() |
|
251 | c = Config() | |
252 | dict.__setitem__(self, key, c) |
|
252 | dict.__setitem__(self, key, c) | |
253 | return c |
|
253 | return c | |
254 | else: |
|
254 | else: | |
255 | try: |
|
|||
256 | return dict.__getitem__(self, key) |
|
|||
257 | except KeyError: |
|
|||
258 | # undefined, create lazy value, used for container methods |
|
255 | # undefined, create lazy value, used for container methods | |
259 | v = LazyConfigValue() |
|
256 | v = LazyConfigValue() | |
260 | dict.__setitem__(self, key, v) |
|
257 | dict.__setitem__(self, key, v) |
General Comments 0
You need to be logged in to leave comments.
Login now