| 490 |
| 491 |
| 492 |
| 493 |
| 494 |
| 495 |
| 496 |
| 497 |
| 498 |
| 499 |
| 500 |
| 501 |
| 502 |
| 503 |
| 504 | |
def sysexec(self, *argv): |
""" return stdout-put from executing a system child process, |
where the self path points to the binary (XXX or script) |
to be executed. Note that this process is directly |
invoked and not through a system shell. |
""" |
from py.compat.subprocess import Popen, PIPE |
argv = map(str, argv) |
proc = Popen([str(self)] + list(argv), stdout=PIPE, stderr=PIPE) |
stdout, stderr = proc.communicate() |
-> ret = proc.wait() |
if ret != 0: |
raise py.process.cmdexec.Error(ret, ret, str(self), |
stdout, stderr,) |
return stdout | |