Tristan Van Berkom pushed to branch master at BuildStream / buildstream
Commits:
-
d868b409
by Daniel Silverstone at 2018-11-01T13:40:24Z
-
7f79b9ce
by Tristan Van Berkom at 2018-11-01T14:25:57Z
1 changed file:
Changes:
... | ... | @@ -1049,6 +1049,12 @@ class ChainMap(collections.ChainMap): |
1049 | 1049 |
for key in clearable:
|
1050 | 1050 |
del self[key]
|
1051 | 1051 |
|
1052 |
+ def get(self, key, default=None):
|
|
1053 |
+ try:
|
|
1054 |
+ return self[key]
|
|
1055 |
+ except KeyError:
|
|
1056 |
+ return default
|
|
1057 |
+ |
|
1052 | 1058 |
|
1053 | 1059 |
def node_chain_copy(source):
|
1054 | 1060 |
copy = ChainMap({}, source)
|