Skip to content

Commit 79d7ed8

Browse files
Merge pull request alecthomas#206 from kellerza/humanize
Handle non-subscriptable path in humanize_error
2 parents 6802ce0 + a30f47f commit 79d7ed8

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

voluptuous/humanize.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ def _nested_getitem(data, path):
99
for item_index in path:
1010
try:
1111
data = data[item_index]
12-
except (KeyError, IndexError):
13-
# The index is not present in the dictionary, list or other indexable
12+
except (KeyError, IndexError, TypeError):
13+
# The index is not present in the dictionary, list or other
14+
# indexable or data is not subscriptable
1415
return None
1516
return data
1617

0 commit comments

Comments
 (0)