Fix missing key error

This commit is contained in:
Schimon Jehudah 2024-01-02 18:45:43 +00:00
parent de200b3b03
commit 9843337e43

View file

@ -61,10 +61,19 @@ def get_value(filename, section, keys):
if isinstance(keys, list):
result = []
for key in keys:
result.extend([section_res[key]])
try:
value = section_res[key]
except:
print("Missing key:", key)
value = ''
result.extend([value])
elif isinstance(keys, str):
key = keys
try:
result = section_res[key]
except:
print("Missing key:", key)
result = ''
return result