Fix numeric keys not working
This commit is contained in:
parent
9b318bf953
commit
8956bb38fc
1 changed files with 2 additions and 0 deletions
|
@ -40,6 +40,8 @@ def get_url_content(url):
|
|||
def get_dict_entry_fallback(d, key, fallback):
|
||||
if key and key in d:
|
||||
return d[key]
|
||||
if key.isnumeric() and int(key) in d:
|
||||
return d[int(key)]
|
||||
if fallback in d:
|
||||
return d[fallback]
|
||||
return d.get('_default', None)
|
||||
|
|
Loading…
Reference in a new issue