Skip to content

Commit

Permalink
Merge pull request #206 from kellerza/humanize
Browse files Browse the repository at this point in the history
Handle non-subscriptable path in humanize_error
  • Loading branch information
tusharmakkar08 committed Sep 22, 2016
2 parents 6802ce0 + a30f47f commit 79d7ed8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions voluptuous/humanize.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ def _nested_getitem(data, path):
for item_index in path:
try:
data = data[item_index]
except (KeyError, IndexError):
# The index is not present in the dictionary, list or other indexable
except (KeyError, IndexError, TypeError):
# The index is not present in the dictionary, list or other
# indexable or data is not subscriptable
return None
return data

Expand Down

0 comments on commit 79d7ed8

Please sign in to comment.