-class SubprocessFailure (Exception):
- def __init__(me, file, rc):
- me.args = (file, rc)
- me.file = file
- me.rc = rc
- def __str__(me):
- if WIFEXITED(me.rc):
- return '%s failed (rc = %d)' % (me.file, WEXITSTATUS(me.rc))
- elif WIFSIGNALED(me.rc):
- return '%s died (signal %d)' % (me.file, WTERMSIG(me.rc))
- else:
- return '%s died inexplicably' % (me.file)
-