parameters: ()
docstring: A context manager to convert some socket errors into EOFError.
docstring_summary: A context manager to convert some socket errors into EOFError.
docstring_tokens: A context manager to convert some socket errors into EOFError .
function: 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
function_tokens: 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