Fix numeric keys not working

This commit is contained in:
Tobias Reisinger 2023-06-23 18:10:50 +02:00
parent 9b318bf953
commit 8956bb38fc
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE

View file

@ -40,6 +40,8 @@ def get_url_content(url):
def get_dict_entry_fallback(d, key, fallback): def get_dict_entry_fallback(d, key, fallback):
if key and key in d: if key and key in d:
return d[key] return d[key]
if key.isnumeric() and int(key) in d:
return d[int(key)]
if fallback in d: if fallback in d:
return d[fallback] return d[fallback]
return d.get('_default', None) return d.get('_default', None)