try:
return load(file)
except FileNotFoundError:
try:
return load(otherfile)
except FileNotFoundError:
return None
How to write it more clean ? I feel there must be a better way to acomplish this (I assume there will be third file to load when other two will fail)
for f in file_list: try: return load(f) except ...…?