Get stdout, stderr, and exit code from running a command
(cmd: str | Sequence[str])
| 7 | |
| 8 | |
| 9 | def get_output_error_code(cmd: str | Sequence[str]) -> tuple[str, str, Any]: |
| 10 | """Get stdout, stderr, and exit code from running a command""" |
| 11 | p = Popen(cmd, stdout=PIPE, stderr=PIPE) # noqa: S603 |
| 12 | out, err = p.communicate() |
| 13 | out_str = out.decode("utf8", "replace") |
| 14 | err_str = err.decode("utf8", "replace") |
| 15 | return out_str, err_str, p.returncode |
| 16 | |
| 17 | |
| 18 | def check_help_output(pkg: str, subcommand: Sequence[str] | None = None) -> tuple[str, str]: |
no outgoing calls
searching dependent graphs…