def genexprThrown():

    def checked(z):
        if z == 3:
            raise ValueError

        return z

    x = ( checked(x) for x in range(9) )

    try:
        for count, value in enumerate(x):
            print(count, value)
    except __HOLE__:
        print(count+1, ValueError)

    try:
        next(x)

        print("Allowed to do next() after raised exception from the generator expression")
    except StopIteration:
        print("Exception in generator, disallowed next() afterwards.")
dataset/ETHPy150Open kayhayen/Nuitka/tests/basics/GeneratorExpressions.py/genexprThrown