(command, stdin=None, **kwargs)
| 34 | raise ProcessException(proc.returncode) |
| 35 | |
| 36 | def pquery(command, stdin=None, **kwargs): |
| 37 | print(' '.join(command)) |
| 38 | proc = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, **kwargs) |
| 39 | stdout, _ = proc.communicate(stdin) |
| 40 | |
| 41 | if proc.returncode != 0: |
| 42 | raise ProcessException(proc.returncode) |
| 43 | |
| 44 | return stdout.decode("utf-8") |
| 45 | |
| 46 | # Directory navigation |
| 47 | @contextlib.contextmanager |
no test coverage detected