diff options
Diffstat (limited to 'py/mock/util.py')
-rw-r--r-- | py/mock/util.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/py/mock/util.py b/py/mock/util.py index f2ddec2..bfaa03a 100644 --- a/py/mock/util.py +++ b/py/mock/util.py @@ -274,11 +274,11 @@ def do(command, chrootPath=None, timeout=0, raiseExc=True, returnOutput=0, uidMa signal.signal(signal.SIGALRM, oldhandler) # mask and return just return value, plus child output - if raiseExc and os.WEXITSTATUS(ret): + if raiseExc and ((os.WIFEXITED(ret) and os.WEXITSTATUS(ret)) or os.WIFSIGNALED(ret)): if returnOutput: - raise mock.exception.Error, "Command failed: \n # %s\n%s" % (command, output) + raise mock.exception.Error, ("Command failed: \n # %s\n%s" % (command, output), ret) else: - raise mock.exception.Error, "Command failed. See logs for output.\n # %s" % command + raise mock.exception.Error, ("Command failed. See logs for output.\n # %s" % (command,), ret) return output |