def _use_text(stdout, stderr, stdin):
    """Are the inputs all str (and so need to use text in subprocess.run)?

        Returns True if subprocess.run(text) should be set to True, otherwise
        False.

        Will raise a TypeError if the inputs are a mix of str and bytes.
    """
    seen_str = False
    seen_bytes = False
    for s in [stdout, stderr, stdin]:
        if s is not None:
            seen_str = seen_str | isinstance(s, str)
            seen_bytes = seen_bytes | isinstance(s, bytes)
    if seen_str and seen_bytes:
        raise TypeError(
            "Mixed use of str & bytes objects for stdout, stderr, and stdin.")

    return not seen_bytes