def iterexcept(call, exception, start=None):
    """
    Call function `call` until `exception` is raised.

    from Raymond Hettinger Python Cookbook recipe # 577155
    """
    try:
        if start is not None:
            yield start()
        while 1:
            yield call()
    except exception:
        pass
