Python Forum
is try/except safe inside of another except?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
is try/except safe inside of another except?
#2
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
Reply


Messages In This Thread
RE: is try/except safe inside of another except? - by scidam - Aug-04-2019, 12:44 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  When is it safe to compare (==) two floats? Radical 4 3,032 Nov-12-2023, 11:53 AM
Last Post: PyDan
  is it safe to close stdin Skaperen 1 3,917 Apr-04-2019, 06:57 AM
Last Post: Gribouillis
  how this to make a asyncio thread safe? linziyan 0 3,097 Jun-07-2018, 10:33 AM
Last Post: linziyan
  Is it safe to use outside a class created inside the function? oneroslavsky 2 3,747 Dec-27-2017, 01:10 AM
Last Post: mpd

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020