Merge pull request #524 from coreos-inc/dictwrapperfix

Fix dict wrapper access to not raise an exception
This commit is contained in:
josephschorr 2015-09-22 14:19:31 -04:00
commit 8e4a3af590

View file

@ -57,10 +57,7 @@ class JSONPathDict(object):
self._object = dict_value
def __getitem__(self, path):
def raise_exception():
raise KeyError('Unknown path: %s' % path)
return self.get(path, not_found_handler=raise_exception)
return self.get(path)
def get(self, path, not_found_handler=None):
""" Returns the value found at the given path. Path is a json-path expression. """