Fix for string key traversal bug #1321827

Gracefully handle the traversal of strings in a key search path.

Closes-Bug: #1321827

Change-Id: I1fab13905fc1f6ed2817081d58fcc5379f2a8515
This commit is contained in:
Coleman Corrigan 2014-05-22 10:56:52 +01:00
parent 6e9aa57e13
commit e3aa1631c1

View File

@ -82,7 +82,7 @@ def print_key(
for key in keys: for key in keys:
try: try:
config = config[key] config = config[key]
except KeyError: except (KeyError, TypeError):
if default is not None: if default is not None:
print(str(default)) print(str(default))
return return