Use ternary statement for return condition
This commit is contained in:
parent
caa0b0b026
commit
ec92888450
@ -58,10 +58,7 @@ def load_list_from_option(parser, *, section="", option="", fallback=None):
|
|||||||
try:
|
try:
|
||||||
return json.loads(parser[section][option])
|
return json.loads(parser[section][option])
|
||||||
except (json.decoder.JSONDecodeError, KeyError):
|
except (json.decoder.JSONDecodeError, KeyError):
|
||||||
if fallback is None:
|
return [] if fallback is None else fallback
|
||||||
return []
|
|
||||||
else:
|
|
||||||
return fallback
|
|
||||||
|
|
||||||
|
|
||||||
def merge_files(files):
|
def merge_files(files):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user