()
A context manager to convert some socket errors into EOFError.
A context manager to convert some socket errors into EOFError.
A context manager to convert some socket errors into EOFError .
def convert_eof():
    """A context manager to convert some socket errors into EOFError."""
    try:
        yield
    except ConnectionResetError:
        raise EOFError
    except BrokenPipeError:
        raise EOFError
    except OSError as exc:
        if exc.errno in EOF:
            raise EOFError
        raise
def convert_eof ( ) : try : yield except ConnectionResetError : raise EOFError except BrokenPipeError : raise EOFError except OSError as exc : if exc . errno in EOF : raise EOFError raise