Aug-04-2019, 12:44 AM
Maybe I something misunderstand, but you can iterate over data locations, e.g. something like this:
def func(): data = None for place in places: try: data = get_data_from_place(place) except CustomException: # or exceptions pass return data