def _is_broken_pipe_error(exc_class, exc):
            """See the docstring for non-Windows Python 3 below."""
            return ((exc_class is BrokenPipeError) or  # noqa: F821
                    (exc_class is OSError and
                     exc.errno in (errno.EINVAL, errno.EPIPE)))
See the docstring for non-Windows Python 3 below.
product/gradle-plugin/src/main/python/pip/_internal/utils/logging.py