def yieldExceptionInteraction2():

    def yield_raise():
        print("Yield finds at generator entry", sys.exc_info()[0])
        try:
            raise ValueError("caught")
        except __HOLE__:
            yield sys.exc_info()[0]
            yield sys.exc_info()[0]
        yield sys.exc_info()[0]

    try:
        undefined_global  # @UndefinedVariable
    except Exception:
        print("Checking from outside of generator with", sys.exc_info()[0])
        g = yield_raise()
        v = next(g)
        print("Initial yield from catch in generator:", v)
        print("Checking from outside the generator:", sys.exc_info()[0])
        print("Second yield from the catch reentered:", next(g))
        print("Checking from outside the generation again:", sys.exc_info()[0])
        print("After leaving the catch generator yielded:", next(g))

    print("After exiting the trying branch:", sys.exc_info()[0])
dataset/ETHPy150Open kayhayen/Nuitka/tests/basics/ExceptionRaising.py/yieldExceptionInteraction2