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

    g = yield_raise()
    print("Initial yield from catch in generator", next(g))
    print("Checking from outside of generator", sys.exc_info()[0])
    print("Second yield from the catch reentered", next(g))
    print("Checking from outside of generator", sys.exc_info()[0])
    print("After leaving the catch generator yielded", next(g))
dataset/ETHPy150Open kayhayen/Nuitka/tests/basics/ExceptionRaising.py/yieldExceptionInteraction