Run a command and raise RuntimeError if it fails. Output is suppressed unless the command fails.
(commandline)
| 518 | return open(fn, 'r').read() |
| 519 | |
| 520 | def runCommand(commandline): |
| 521 | """ |
| 522 | Run a command and raise RuntimeError if it fails. Output is suppressed |
| 523 | unless the command fails. |
| 524 | """ |
| 525 | fd = os.popen(commandline, 'r') |
| 526 | data = fd.read() |
| 527 | xit = fd.close() |
| 528 | if xit is not None: |
| 529 | sys.stdout.write(data) |
| 530 | raise RuntimeError("command failed: %s"%(commandline,)) |
| 531 | |
| 532 | if VERBOSE: |
| 533 | sys.stdout.write(data); sys.stdout.flush() |
| 534 | |
| 535 | def captureCommand(commandline): |
| 536 | fd = os.popen(commandline, 'r') |
no test coverage detected
searching dependent graphs…