parse_result_envelope()
Parse a {is_error, result} JSON envelope into its result text.
Usage
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
resultpayload.
Raises
subprocess.CalledProcessError- When the envelope marks the run as an error.