Fix dict wrapper access to not raise an exception
This commit is contained in:
parent
4a79311d26
commit
40f3b7137d
1 changed files with 1 additions and 4 deletions
|
@ -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. """
|
||||
|
|
Reference in a new issue