Issue with breakpoints and exception handling in the Script Editor

Hi All,

When trying to run to a breakpoint after an Exception has been raised (and handled), the editor will not stop on the breakpoint. The example code below shows this.

If I put a breakpoint on the call to “second_function()”, the debugger does not stop on that line.

Have I done something wrong, or is there a problem with the editor?

Thanks for your help.

#! python 3

def first_function() -> None:
    print("Start of first_function")
    raise Exception("First Problem")

def second_function() -> None:
    print("Start of second_function")
    raise Exception("Second Problem")

def main() -> None:
    print("Start")
    try:
        first_function()
    except Exception as error:
        print(f"first_function run: {error}")

    print("Between Functions")
    try:
        second_function()
    except Exception as error:
        print(f"second_function run: {error}")

    print("End")

if __name__ == "__main__":
    main()

I can replicate this. Thanks for reporting. Looking into it now. Which Rhino version are you using?

RH-99666 Python 3 debugger exception handling is buggy

Thanks Ehsan. I’m using Rhino 8.