(command)
| 89 | |
| 90 | |
| 91 | def exec_cmd(command): |
| 92 | log.info(f"executing {command}") |
| 93 | process = subprocess.Popen( |
| 94 | command, |
| 95 | stdout=subprocess.PIPE, |
| 96 | stderr=subprocess.PIPE, |
| 97 | text=True, # If you want to handle the output as strings rather than bytes |
| 98 | bufsize=1, # Line buffered |
| 99 | universal_newlines=True, |
| 100 | shell=True, |
| 101 | encoding="utf-8", |
| 102 | errors="replace" |
| 103 | ) |
| 104 | for stdout_line in iter(process.stdout.readline, ""): |
| 105 | yield stdout_line |
| 106 | return_code = process.wait() |
| 107 | for stderr_line in iter(process.stderr.readline, ""): |
| 108 | yield stderr_line |
no test coverage detected