parse_result_envelope()

Parse a {is_error, result} JSON envelope into its result text.

Usage

Source

parse_result_envelope(
    stdout,
    *,
    argv,
    stderr,
)

Parameters

stdout: bytes

Raw stdout bytes holding the envelope.

argv: list[str]

The argv that produced the output, for error reporting.

stderr: bytes
Raw stderr bytes, attached to the error.

Returns

str
The result payload.

Raises

subprocess.CalledProcessError
When the envelope marks the run as an error.